"use client"

import * as Sentry from "@sentry/nextjs"
import { useEffect } from "react"
import { useIntl } from "react-intl"

import type { ErrorPage } from "@/types/next/error"

export default function ProfileError({ error }: ErrorPage) {
  const intl = useIntl()

  useEffect(() => {
    if (!error) return

    console.error(error)
    Sentry.captureException(error)
  }, [error])

  return <h1>{intl.formatMessage({ id: "Error happened, Profile" })}</h1>
}
