This commit is contained in:
seb
2026-09-29 09:30:43 +02:00
parent c4f8ebb41b
commit 18419b1615
33 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { useParams } from 'react-router-dom';
/** Injects numeric `entityId` from `/kunde/:entityId`. */
export default function withEntityRoute(Wrapped) {
function EntityRouteWrapper(props) {
const { entityId: raw } = useParams();
const entityId = Number(raw);
return (
<Wrapped
{...props}
entityId={Number.isInteger(entityId) ? entityId : null}
/>
);
}
return EntityRouteWrapper;
}