"use client"; /* Damage reported from the staff app that has not come back to the counter yet. */ import Link from "next/link"; import { useSnap } from "@/lib/client"; import { Empty } from "@/components/ui"; import { MonoNum, Panel, Tag } from "@/components/portal"; import { formatInZone } from "@/lib/compute"; import type { DamageRow } from "./RequestList"; export default function Damage({ rows, act }: { rows: DamageRow[]; act: (op: "damage.handedIn", payload: Record) => Promise }) { const { s } = useSnap(); return ( {rows.length === 0 ? (
Nothing reported damaged that hasn't come back yet.
) : rows.map((d) => (
{d.photoId && ( {/* eslint-disable-next-line @next/next/no-img-element */} )}
{d.item ? d.item : "Garment no longer on file"} {d.item && d.size && <> — {d.size}} · {d.staffName}{d.ward ? ` (${d.ward})` : ""} {" "}{d.kind}
{formatInZone(d.at, s.tz)} {" · "}{d.requestCode ? <>replacement {d.requestCode} : "no replacement asked for"}
{d.note &&

“{d.note}”

}
Open record
))}
); }