"use client"

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

export default function Error({
  error,
}: {
  error: Error & { digest?: string }
}) {
  useEffect(() => {
    if (!error) return

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

  return null
}
