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.
This commit is contained in:
20
src/components/manifest/withManifestId.jsx
Normal file
20
src/components/manifest/withManifestId.jsx
Normal file
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user