import Link from "next/link";
import { useRouter } from "next/router";
import { HomeIcon } from "~/components/IconComponents";
import { useTranslation } from "~/providers/I18nProvider";
import { Button } from "./ui/button";

export default function FailedAnnuncioLoading() {
	const router = useRouter();
	const { t } = useTranslation();
	return (
		<main>
			<div className="mx-auto flex h-screen max-w-screen-xl items-center justify-start px-4 md:px-8">
				<div className="mx-auto max-w-lg space-y-3 text-center">
					<HomeIcon className="mx-auto size-20 text-destructive" />
					<h3 className="font-semibold text-4xl text-accent-foreground sm:text-5xl">
						{t.annuncio_load_fail.titolo}
					</h3>
					<p className="">{t.annuncio_load_fail.sottotitolo}</p>
					<div className="flex flex-wrap items-center justify-center gap-3">
						<Button
							onClick={() => {
								router.back();
							}}
							size="lg"
							variant="destructive"
						>
							{t.annuncio_load_fail.CTA}
						</Button>

						<Link
							//className="block rounded-lg border border-border px-4 py-2 font-medium duration-150"
							href="/annunci"
						>
							<Button size="lg" variant="outline">
								{t.annuncio_load_fail.home}
							</Button>
						</Link>
					</div>
				</div>
			</div>
		</main>
	);
}
