+
{
+ const file = e.target.files?.[0];
+ if (file) void uploadQuote(file);
+ // Let the same file be picked again.
+ if (quoteRef.current) quoteRef.current.value = "";
+ }}
+ />
+
+
+
{repair.repair_number}
+
+ {REPAIR_STATUS_LABEL[repair.status] || repair.status}
+
+
+
+ {step ? (
+
+ ) : null}
+
+ {notice ? (
+
+
{notice.text}
+ {notice.link ? (
+
+ Open this repair in the office
+
+ ) : null}
+
+ ) : null}
+
+ {error ? (
+
+ {error}
+
+ ) : null}
+
+
+ {repair.item_description}
+
+
+
- Whose machine
+ - {customerName}
+
+
+
- Serial number
+ - {repair.serial_no}
+
+
+
- Customer says
+ - {repair.fault_description}
+
+ {repair.supplier_scope ? (
+
+
- Supplier to look at
+ - {repair.supplier_scope}
+
+ ) : null}
+ {supplierName ? (
+
+
- Supplier
+ - {supplierName}
+
+ ) : null}
+
+
+
+
+ Photos
+ {photoFiles.length > 0 ? (
+
+ {photoFiles.map((name) => (
+ -
+ {photoUrls[name] ? (
+ // eslint-disable-next-line @next/next/no-img-element
+
+ ) : failedPhotos.includes(name) ? (
+
+ Could not load this photo
+
+ ) : (
+
+ Loading…
+
+ )}
+
+ ))}
+
+ ) : (
+ No photos yet
+ )}
+
+
+
+
+ Take a photo of the machine now, if you are still at the site.
+
+
{
+ const file = e.target.files?.[0];
+ if (file) void uploadPhoto(file);
+ // Let the same file be picked again.
+ if (photoRef.current) photoRef.current.value = "";
+ }}
+ />
+
+
+ {photoError ? (
+
+ {photoError}
+
+ ) : null}
+
+
+
+ Documents
+
+ {DOCUMENTS.map((doc) => {
+ const files = repair[doc.field] ?? [];
+ return (
+ -
+
{doc.label}
+ {files.length === 0 ? (
+ None yet
+ ) : (
+
+ {files.map((name) => (
+ -
+
+
+ ))}
+
+ )}
+
+ );
+ })}
+
+
+
+
+ Progress
+
+ {REPAIR_STATUS.map((s: RepairStatus) => (
+ -
+ {REPAIR_STATUS_LABEL[s]}
+ {s === repair.status ? " — now" : ""}
+
+ ))}
+
+
+
+ );
+}