+
Repairs
+
+
setSearch(e.target.value)}
+ className="min-h-[48px] w-full rounded-md border bg-background px-3 text-base"
+ />
+
+
+ {chips.map((chip) => {
+ const active = chip.key === status;
+ return (
+
+ );
+ })}
+
+
+ {error ? (
+
+ {error}
+
+ ) : null}
+
+ {loading ? (
+
Loading repairs…
+ ) : null}
+
+ {!loading && !error && repairs.length === 0 ? (
+
+ No repairs match this filter.
+
+ ) : null}
+
+
+ {repairs.map((repair) => (
+ -
+
+
+ {repair.repair_number}
+
+ {REPAIR_STATUS_LABEL[repair.status] || repair.status}
+
+
+ {repair.item_description}
+
+ {customerName(repair)}
+ {repair.serial_no ? " · S/N " + repair.serial_no : ""}
+
+
+ {photoCount(repair) > 0
+ ? photoCount(repair) +
+ " photo" +
+ (photoCount(repair) === 1 ? "" : "s")
+ : "No photos"}
+ {supplierName(repair) ? " · " + supplierName(repair) : ""}
+
+
+
+ ))}
+
+
+ {/* Sits just above the shell's fixed tab bar. */}
+
+
+ Book in a machine
+
+
+
+ );
+}
+
+/**
+ * Authorization header for the repairs routes.
+ *
+ * The browser session lives in the PocketBase auth store — the same
+ * instance the auth provider uses — NOT on the auth context, so it is
+ * read from there directly. Same helper as the office repairs page.
+ */
+function authHeaders(): Record