import { useState } from 'react' interface GlobalErrorProps { error: Error | unknown } export default function GlobalError({ error }: GlobalErrorProps) { console.error('Error in root route:', error) const [showFull, setShowFull] = useState(false) return (
Something went wrong. Try to{' '}
{' '}
or
feel free to{' '}
contact us
{' '}
if the problem persists.
{error instanceof Error
? showFull
? error.stack
: error.stack?.slice(0, 200)
: String(error)}