{"version":3,"file":"error-boundary-BGASnb7U.js","sources":["../../../app/components/error-boundary.tsx"],"sourcesContent":["import {\n type ErrorResponse,\n isRouteErrorResponse,\n useParams,\n} from '@remix-run/react'\nimport { getErrorMessage, useCapturedRouteError } from '~/utils/misc.tsx'\n\ntype StatusHandler = (info: {\n error: ErrorResponse\n params: Record\n}) => JSX.Element | null\n\nexport function GeneralErrorBoundary({\n defaultStatusHandler = ({ error }) => (\n

\n {error.status} {error.data}\n

\n ),\n statusHandlers,\n unexpectedErrorHandler = error =>

{getErrorMessage(error)}

,\n}: {\n defaultStatusHandler?: StatusHandler\n statusHandlers?: Record\n unexpectedErrorHandler?: (error: unknown) => JSX.Element | null\n}) {\n const error = useCapturedRouteError()\n const params = useParams()\n\n if (typeof document !== 'undefined') {\n console.error(error)\n }\n\n return (\n
\n {isRouteErrorResponse(error)\n ? (statusHandlers?.[error.status] ?? defaultStatusHandler)({\n error,\n params,\n })\n : unexpectedErrorHandler(error)}\n
\n )\n}\n"],"names":["GeneralErrorBoundary","defaultStatusHandler","error","statusHandlers","unexpectedErrorHandler","jsx","getErrorMessage","useCapturedRouteError","params","useParams","isRouteErrorResponse"],"mappings":"iHAYO,SAASA,EAAqB,CACnC,qBAAAC,EAAuB,CAAC,CAAE,MAAAC,CAAM,WAC7B,IACE,CAAA,SAAA,CAAMA,EAAA,OAAO,IAAEA,EAAM,IAAA,EACxB,EAEF,eAAAC,EACA,uBAAAC,EAAkCF,GAAAG,MAAC,IAAG,CAAA,SAAAC,EAAgBJ,CAAK,CAAE,CAAA,CAC/D,EAIG,CACD,MAAMA,EAAQK,EAAsB,EAC9BC,EAASC,EAAU,EAErB,OAAA,OAAO,SAAa,KACtB,QAAQ,MAAMP,CAAK,EAInBG,EAAA,IAAC,MAAI,CAAA,UAAU,kEACZ,SAAAK,EAAqBR,CAAK,IACtBC,GAAA,YAAAA,EAAiBD,EAAM,UAAWD,GAAsB,CACvD,MAAAC,EACA,OAAAM,CAAA,CACD,EACDJ,EAAuBF,CAAK,EAClC,CAEJ"}