import { isRouteErrorResponse } from 'react-router' import { getSubscribePlan } from '~/apis/common/get-subscribe-plan' import { SubscribePlanPage } from '~/pages/dashboard-subscribe-plan' import type { Route } from './+types/_admin.lg-admin._dashboard.subscribe-plan._index' export const loader = async ({}: Route.LoaderArgs) => { const { data: subscribePlanData } = await getSubscribePlan() return { subscribePlanData } } export const ErrorBoundary = ({ error }: Route.ErrorBoundaryProps) => { let message = 'Oops!' let details = 'An unexpected error occurred.' let stack: string | undefined if (isRouteErrorResponse(error)) { message = error.status === 404 ? '404' : 'Error' details = error.status === 404 ? 'The requested page could not be found.' : error.statusText || details } else if (import.meta.env.DEV && error && error instanceof Error) { details = error.message stack = error.stack } return (

{message}

{details}

{stack && (
          {stack}
        
)}
) } const DashboardSubscriptionsSettingsLayout = () => export default DashboardSubscriptionsSettingsLayout