Wire quote/order API clients and routes, then unify list/create/edit behind ManifestList/Form tiles so Lieferungen and Auftrag share one stack.
21 lines
541 B
JavaScript
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;
|
|
}
|