// app/error.tsx
'use client';

import { useEffect } from 'react';

export default function RootError({
	error
}: {
	error: Error & { digest?: string }
}) {

	useEffect(() => {
		console.error(error);
	}, [error]);

	return (
		<div className="flex items-center justify-center min-h-screen bg-gray-50 px-4 text-center">
			<dl className='border pt-5 ps-8 pe-8 rounded-lg shadow-md bg-white'>
				<dt className='text-xl font-bold text-red-500'>
					[500] Internal Server Error
				</dt>
				<dd className='p-6'>
					<p className='pb-3'>- 원인 -</p>
					{error.message}
				</dd>
			</dl>
		</div>
	);
}