"use client"; import type { CheckinLinkControls } from "@/hooks/useCheckinLink"; import { formatDateTime } from "@/lib/date-time"; import { QrCode } from "@/components/checkin/qr-code"; import { Button } from "@/components/ui/button"; import { LinkAddressField } from "@/components/ui/link-address-field"; // The live link, on screen only. A link made in this visit comes with its QR code and // address; one found on a later visit has neither, the API having kept only a hash. export function CheckInLinkPanel({ sharing, }: { sharing: CheckinLinkControls; }) { const { live } = sharing; if (!live) return null; const expires = formatDateTime(live.expiresAt); const url = live.url; return (
{url && ( )}
{url ? (

Anyone with this link sees this page as it prints, until {expires}.

) : ( <>

A link to this page works until {expires}.

Its address can’t be shown again, because only a fingerprint of it is kept — Share makes a new link and retires this one.

)} {url && ( )}
); }