Files
dashfront/src/components/manifest/withManifestId.jsx
seb 4896b1dc36 Add shared Manifest UI for delivery, quote, and order.
Wire quote/order API clients and routes, then unify list/create/edit behind ManifestList/Form tiles so Lieferungen and Auftrag share one stack.
2026-08-06 20:08:56 +02:00

21 lines
541 B
JavaScript

import { useParams } from 'react-router-dom';
/**
* Router glue only: maps a path param to `docId` (integer or null).
* Function component is intentional — useParams has no class equivalent.
*/
export function withManifestId(paramName, Wrapped) {
function ManifestIdWrapper(props) {
const params = useParams();
const raw = params[paramName];
const docId = Number(raw);
return (
<Wrapped
{...props}
docId={Number.isInteger(docId) ? docId : null}
/>
);
}
return ManifestIdWrapper;
}