;
+
+function countAttached(documents: BookingDocuments): number {
+ return BOOKING_DOCS_SETTING.fields.filter((f) => {
+ const value = documents[f.fileKey];
+ return Array.isArray(value) ? value.length > 0 : Boolean(value);
+ }).length;
+}
+
+export function StepDocuments({ form }: { form: BookingForm }) {
+ const documents = (form.watch("documents") ?? {}) as BookingDocuments;
+ const attached = countAttached(documents);
+ const total = BOOKING_DOCS_SETTING.fields.length;
+
+ return (
+
+
+
+
+
+ {attached === total ? : `${attached}/${total}`}
+
+
+ {attached === 0
+ ? "All documents are optional here — you can upload them later from the booking page."
+ : `${attached} of ${total} attached. You can finish the rest later from the booking page.`}
+
+
+
+ (
+ field.onChange(value)}
+ />
+ )}
+ />
+
+ );
+}
diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/steps.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/steps.tsx
index 7e47282aa..9f1445f91 100644
--- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/steps.tsx
+++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/steps.tsx
@@ -2,4 +2,5 @@ export { Step1ContractType } from "./step1-contract-type";
export { Step2ServiceType } from "./step2-service-type";
export { Step4Route } from "./step4-route";
export { Step5CargoDetails } from "./step5-cargo-details";
+export { StepDocuments } from "./step-documents";
export { Step8Review } from "./step8-review";