import { SupportCategories } from '@supabase/shared-types/out/constants' import { safeLocalStorage, safeSessionStorage } from 'common' import { ExternalLink } from 'lucide-react' import { useRouter } from 'next/router' import { Button, cn } from 'ui' import { Admonition } from 'ui-patterns' import CopyButton from '../CopyButton' import { InlineLinkClassName } from '../InlineLink' import { SupportLink } from '@/components/interfaces/Support/SupportLink' interface ClientSideExceptionHandlerProps { message: string sentryIssueId: string urlMessage: string resetErrorBoundary: () => void } export const ClientSideExceptionHandler = ({ message, sentryIssueId, urlMessage, resetErrorBoundary, }: ClientSideExceptionHandlerProps) => { const router = useRouter() const isProduction = process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' const handleClearStorage = () => { safeLocalStorage.clear() safeSessionStorage.clear() window.location.reload() } return ( <>
Sorry! An unexpected error occurred.
Application error: a client-side exception has occurred (see browser console for more information)
{message}