-
-
- Containers
-
-
-
-
- {fields.map((field, index) => {
- const containerType = containers[index]?.type;
- const vgm = containers[index]?.vgm ?? 0;
- const alert = (() => {
- if (containerType === "20ft" && +vgm > 0) {
- const limit = direction === "export" ? 25 : 20;
- if (+vgm > limit) {
- return `VGM ${vgm}t exceeds the ${limit}t ${direction ?? "standard"} limit for a 20ft container. An Overweight Surcharge will apply.`;
- }
- }
- if (containerType === "40ft" && +vgm > 32.5) {
- return `VGM ${vgm}t exceeds the 32.5t global limit for a 40ft container. An Overweight Surcharge will apply.`;
- }
- return null;
- })();
-
- return (
-
-
-
- Container {index + 1}
-
- {fields.length > 1 && (
-
- )}
-
-
-
- (
-
- )}
- />
-
- (
-
- )}
- />
-
- (
-
- Quantity *
- qtyField.onChange(e.target.value)}
- onBlur={qtyField.onBlur}
- type="number"
- aria-invalid={fieldState.invalid}
- min="1"
- />
-
-
- )}
- />
-
- (
-
- VGM (Tons) *
- vgmField.onChange(e.target.value)}
- onBlur={vgmField.onBlur}
- type="number"
- aria-invalid={fieldState.invalid}
- placeholder="e.g. 18.5"
- min="0"
- step="0.1"
- />
-
-
- )}
- />
-
-
- {alert && (
-
- Overweight Alert: {alert}
-
- )}
-
- );
- })}
-
- {containers && (() => {
- const Ft40Wagons = containers
- .filter((c) => c.type === "40ft")
- .reduce((sum, c) => sum + Number(c.qty), 0);
- const Ft20Wagons = containers
- .filter((c) => c.type === "20ft")
- .reduce((sum, c) => sum + Number(c.qty), 0);
- const hasOddUnit = Ft20Wagons % 2 === 1;
- if (hasOddUnit) {
- return (
-
-
-
-
Unpaired 20ft Container
-
- One 20ft container occupies only half a wagon. The wagon
- will depart once a co-loader is found to fill the
- remaining slot, which{" "}
- may delay departure beyond the standard
- lead time.
-
-
-
-
- );
- }
- return null;
- })()}
-
- )}
-