This commit implements the core admin dashboard functionality including NextAuth authentication, Cloudflare D1 database integration with complete schema, and Cloudflare R2 file upload system for portfolio images. Features include artist management, appointment scheduling, and data migration capabilities.
34 lines
833 B
TypeScript
34 lines
833 B
TypeScript
"use client"
|
|
|
|
import React, { useEffect } from "react"
|
|
|
|
export default function GlobalError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
reset: () => void
|
|
}) {
|
|
useEffect(() => {
|
|
// Log the error for debugging
|
|
console.error(error)
|
|
}, [error])
|
|
|
|
return (
|
|
<div className="min-h-[50vh] flex items-center justify-center p-8">
|
|
<div className="text-center space-y-3">
|
|
<h2 className="text-xl font-semibold">Something went wrong</h2>
|
|
<p className="text-sm text-muted-foreground">
|
|
{error?.message || "An unexpected error occurred."}
|
|
</p>
|
|
<button
|
|
onClick={() => reset()}
|
|
className="inline-flex items-center rounded-md border px-3 py-1.5 text-sm hover:bg-accent"
|
|
>
|
|
Try again
|
|
</button>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|