25 lines
736 B
TypeScript
25 lines
736 B
TypeScript
// TreasureRow.tsx
|
|
// Displays a single treasure with discovered checkbox and text.
|
|
import type { Treasure } from "@/lib/types";
|
|
|
|
/**
|
|
* Renders a treasure row with a discovered checkbox and treasure text.
|
|
* Handles updating the discovered state and discoveredIn relationship.
|
|
*/
|
|
export const TreasurePrintRow = ({ treasure }: { treasure: Treasure }) => {
|
|
return (
|
|
<div className="flex items-center gap-3">
|
|
<input
|
|
type="checkbox"
|
|
className="flex-none accent-emerald-500 w-5 h-5"
|
|
aria-label="Discovered"
|
|
/>
|
|
<span>
|
|
{(treasure.data as any)?.treasure?.text || (
|
|
<span className="italic text-slate-400">(No treasure text)</span>
|
|
)}
|
|
</span>
|
|
</div>
|
|
);
|
|
};
|