Archived
38 lines
1.8 KiB
TypeScript
38 lines
1.8 KiB
TypeScript
import React from "react";
|
|
|
|
type Props = {
|
|
code: string;
|
|
/** Checked in on an offline desk: nothing was sent to the parents. */
|
|
offline?: boolean;
|
|
kids: { id: string; firstName: string; room: string | null; sticker: string; already?: boolean }[];
|
|
};
|
|
|
|
/**
|
|
* "Write on the sticker": what volunteers copy onto a blank name sticker for each child — first
|
|
* name, room, pickup code and a short allergy/medical alert — in print big enough to copy at a
|
|
* glance. Nothing is printed; the full details stay on screen.
|
|
*/
|
|
export function StickerPanel({ code, kids, offline = false }: Props) {
|
|
return (
|
|
<div>
|
|
<div className="text-center mb-3">
|
|
<div className="text-xs uppercase tracking-wide text-gray-500">Pickup code</div>
|
|
<div className="text-6xl font-black font-mono tracking-[0.25em]" data-testid="desk-code">{code}</div>
|
|
<div className="text-xs text-gray-500">{offline ? "Offline: nothing was sent — tell the parent the code." : "Sent to the parents. Tell them too, in case the message is slow."}</div>
|
|
</div>
|
|
<div className="text-xs uppercase tracking-wide text-gray-500 mb-2">Write on the sticker</div>
|
|
<div className="grid sm:grid-cols-2 gap-3">
|
|
{kids.map(c => (
|
|
<div key={c.id} className="border-2 border-dashed border-gray-400 rounded-xl p-4 bg-white" data-testid="sticker">
|
|
<div className="text-3xl font-bold leading-tight">{c.firstName}</div>
|
|
<div className="text-lg text-gray-700">{c.room || "—"}</div>
|
|
<div className="mt-1 text-2xl font-mono font-bold tracking-widest">{code}</div>
|
|
{c.sticker && <div className="mt-1 text-lg font-bold text-red-700">{c.sticker}</div>}
|
|
{c.already && <div className="mt-1 text-xs text-gray-500">Was already checked in.</div>}
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|