"use client"

import { EmptyState } from "@/shared/components/ui/empty-state"
import { AlertTriangle } from "lucide-react"
import { useTranslations } from "next-intl"

export default function ParentError({
  error,
  reset,
}: {
  error: Error & { digest?: string }
  reset: () => void
}) {
  const t = useTranslations("common")

  return (
    <div className="p-6 md:p-8">
      <EmptyState
        icon={AlertTriangle}
        title={t("somethingWentWrong")}
        description={error.message || "An unexpected error occurred. Please try again."}
        action={{ label: t("tryAgain"), onClick: reset }}
      />
    </div>
  )
}
