import { useParams } from 'react-router-dom';

/** Parses the certificate id from the route, if present. */
export const useCertificateId = (): number | undefined => {
  const params = useParams();
  return params.id ? Number(params.id) : undefined;
};
