import { NextPageContext } from 'next';
function Error({ statusCode }: { statusCode?: number }) {
  return (
    <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh', backgroundColor: '#09090B', color: '#F4F4F5' }}>
      <div style={{ textAlign: 'center' }}>
        <h1 style={{ fontSize: 48, fontWeight: 800, marginBottom: 8 }}>{statusCode || 'Error'}</h1>
        <p style={{ color: '#71717a' }}>{statusCode === 404 ? 'Page not found' : 'An error occurred'}</p>
      </div>
    </div>
  );
}
Error.getInitialProps = ({ res, err }: NextPageContext) => {
  const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
  return { statusCode };
};
export default Error;
