"use client"; import { Component, type ReactNode } from "react"; import { Icon } from "@iconify/react"; import { useTranslations } from "next-intl"; type Props = { children: ReactNode }; type State = { hasError: boolean; error: Error | null }; export class ErrorBoundary extends Component { constructor(props: Props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error: Error): State { return { hasError: true, error }; } render() { if (this.state.hasError && this.state.error) { return ; } return this.props.children; } } function ErrorFallback({ error }: { error: Error }) { const t = useTranslations("ErrorBoundary"); return (

{t("title")}

{error.message}

); }