"use client"

import { ShieldAlert } from "lucide-react"
import type { ReactElement } from "react"
import { Button } from "@/shared/components/ui/button"

export default function AdminRolesError({
  error,
  reset,
}: {
  error: Error & { digest?: string }
  reset: () => void
}): ReactElement {
  return (
    <div className="flex h-full flex-col items-center justify-center space-y-4 p-8">
      <ShieldAlert className="h-12 w-12 text-destructive" aria-hidden="true" />
      <h2 className="text-xl font-semibold">角色管理加载失败</h2>
      <p className="text-sm text-muted-foreground">{error.message}</p>
      <Button onClick={reset}>重试</Button>
    </div>
  )
}
