'use client'
import { useEffect } from 'react'
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
useEffect(() => {
console.error('Design system test error:', error)
}, [error])
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50">
<div className="max-w-md w-full bg-white shadow-lg rounded-lg p-8">
<div className="flex items-center justify-center w-12 h-12 mx-auto bg-red-100 rounded-full">
<svg
className="w-6 h-6 text-red-600"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
/>
</svg>
</div>
<h2 className="mt-4 text-xl font-semibold text-center text-gray-900">
Error Loading Design System
</h2>
<p className="mt-2 text-sm text-center text-gray-600">
An error occurred while loading the design system test page.
</p>
{error.digest && (
<p className="mt-2 text-xs text-center text-gray-500">
Error ID: {error.digest}
</p>
)}
<div className="mt-6 flex gap-3">
<button
onClick={reset}
className="flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
>
Try again
</button>
<button
onClick={() => window.location.href = '/'}
className="flex-1 px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors"
>
Go home
</button>
</div>
</div>
</div>
)
}