Skip to content

Commit

Permalink
fix(status-page): add missing header and footer
Browse files Browse the repository at this point in the history
rogeriopvl committed Jul 9, 2024
1 parent e618d4b commit ae3e7f2
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions app/status/[status]/page.tsx
Original file line number Diff line number Diff line change
@@ -2,40 +2,49 @@ import { Metadata } from 'next';
import Image from 'next/image';
import Link from 'next/link';

import { getStatusInfo } from '@/lib/status-info';
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import StatusDescription from '@/components/StatusDescription';

import statuses from '@/lib/statuses';
import { getStatusInfo } from '@/lib/status-info';
import { getTranslations } from '@/lib/translation';

export default async function Info({ params }: { params: { status: string } }) {
const statusObj = statuses[params.status as unknown as keyof typeof statuses];
const statusInfoHTML = await getStatusInfo(params.status);

const t = await getTranslations('en');

return (
<main>
<nav>
<Link href="/" className="text-white">{`< Back to home`}</Link>
</nav>
<>
<Header t={t} />
<main>
<nav>
<Link href="/" className="text-white">{`< Back to home`}</Link>
</nav>

<h1 className="text-center my-12">
{statusObj.code} {statusObj.message}
</h1>
<h1 className="text-center my-12">
{statusObj.code} {statusObj.message}
</h1>

<div className="text-center">
<Image
src={`/images/${statusObj.code.toString()}.jpg`}
alt={statusObj.message}
width={750}
height={600}
className="w-full h-full max-w-3xl"
/>
</div>
<section className="flex justify-center tracking-wider">
<StatusDescription>
<div dangerouslySetInnerHTML={{ __html: statusInfoHTML }} />
</StatusDescription>
</section>
</main>
<div className="text-center">
<Image
src={`/images/${statusObj.code.toString()}.jpg`}
alt={statusObj.message}
width={750}
height={600}
className="w-full h-full max-w-3xl"
/>
</div>
<section className="flex justify-center tracking-wider">
<StatusDescription>
<div dangerouslySetInnerHTML={{ __html: statusInfoHTML }} />
</StatusDescription>
</section>
</main>
<Footer t={t} />
</>
);
}

0 comments on commit ae3e7f2

Please sign in to comment.