Files
sass-mohfarawati/app/[locale]/(site)/success/page.tsx
T

81 lines
2.9 KiB
TypeScript

import type { Metadata } from "next";
import { CheckCircle2 } from "lucide-react";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type SuccessPageProps = {
params: {
locale: string;
};
};
export async function generateMetadata({
params: { locale },
}: SuccessPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
return await buildLocalizedMetadata({
locale: localeKey,
pathname: "/success",
title: t("title"),
description: t("text"),
});
}
export default async function SuccessPage({ params: { locale } }: SuccessPageProps) {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
return (
<>
<section className="hero-surface hero-page relative isolate overflow-hidden pb-12 pt-24 sm:pt-28 lg:pb-16 lg:pt-32">
<Container size="narrow" className="text-center">
<MotionFade className="w-full">
<div className="mx-auto flex max-w-[42rem] flex-col items-center">
<CheckCircle2 className="h-14 w-14 text-status-success" />
<p className="mt-5 text-sm font-medium tracking-[-0.02em] text-foreground/58">
{t("title")}
</p>
<h1 className="mt-4 text-balance text-4xl font-semibold leading-[0.9] tracking-[-0.07em] text-foreground sm:text-5xl lg:text-[4.5rem]">
{t("title")}
</h1>
<p className="mx-auto mt-5 max-w-[32rem] text-sm leading-6 text-foreground/64 sm:text-base">
{t("text")}
</p>
<div className="mt-8 flex flex-wrap items-center justify-center gap-3">
<Button asChild>
<Link href={getLocalizedPath(localeKey)}>{t("home")}</Link>
</Button>
<Button asChild variant="outline">
<Link href={getLocalizedPath(localeKey, "/contact")}>{t("contact")}</Link>
</Button>
</div>
</div>
</MotionFade>
</Container>
</section>
<Container size="narrow" className="pb-12 lg:pb-16">
<MotionFade className="w-full" delay={0.06}>
<AppCard level={3}>
<CardContent className="p-8 text-center">
<p className="mx-auto max-w-2xl text-base text-muted-foreground">
{t("text")}
</p>
</CardContent>
</AppCard>
</MotionFade>
</Container>
</>
);
}