Property Management Network — Next.js 16 (App Router), Better Auth, Drizzle ORM over PostgreSQL, Stripe, OpenAI, Resend. Includes: - Security hardening: access-control/IDOR fixes, TLS-by-default DB layer, constant-time cron auth, strict security headers, atomic AI quota gating, HTML/email output encoding, demo-backdoor disabled in production. - Superadmin dashboard at /admin (overview/MRR, server-paginated users with ban/impersonate/plan/delete, billing, platform activity + admin audit log, AI usage, system health) via the Better Auth admin plugin. - Seed/migration utility scripts under scripts/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
import { AlertTriangle, RefreshCw } from "lucide-react"
|
|
|
|
export default function DashboardError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
reset: () => void
|
|
}) {
|
|
useEffect(() => {
|
|
console.error(error)
|
|
}, [error])
|
|
|
|
return (
|
|
<div className="flex min-h-[400px] flex-col items-center justify-center rounded-xl border border-red-500/10 bg-red-500/5 text-center">
|
|
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-red-500/10 mb-4">
|
|
<AlertTriangle className="h-6 w-6 text-red-400" />
|
|
</div>
|
|
<h2 className="text-base font-semibold text-white">Something went wrong</h2>
|
|
<p className="mt-2 max-w-sm text-sm text-white/50">
|
|
{error.message || "An unexpected error occurred. Try refreshing the page."}
|
|
</p>
|
|
<button
|
|
onClick={reset}
|
|
className="mt-6 flex items-center gap-2 rounded-lg border border-white/10 px-4 py-2 text-sm text-white/60 transition hover:border-white/20 hover:text-white"
|
|
>
|
|
<RefreshCw className="h-4 w-4" />
|
|
Try again
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|