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 ( ); } return ManifestIdWrapper; }