import { Link } from '@inertiajs/react';
import Shell from '../layouts/Shell';

export default function Error({ error }: { error: { status: number; message: string } }) {
    const heading = error.status === 404 ? 'Page not found' : error.message;

    return (
        <Shell>
            <div className="wrap account-page">
                <section className="form-panel">
                    <p className="kicker">{error.status}</p>
                    <h1>{heading}</h1>
                    <Link className="solid" href="/">
                        Back to journal <span className="arrow" aria-hidden="true" />
                    </Link>
                </section>
            </div>
        </Shell>
    );
}
