import Link from "next/link";
import { useRouter } from "next/router";
import { useTranslation } from "~/providers/I18nProvider";
import { QuestionMarkCircleIcon } from "~/components/IconComponents";
export default function Custom404() {
  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">
          <QuestionMarkCircleIcon className="mx-auto size-20 text-indigo-600" />
          <h3 className="text-accent-foreground text-4xl font-semibold sm:text-5xl">
            {t[404].titolo}
          </h3>
          <p className="text-neutral-600">{t[404].sottotitolo}</p>
          <div className="flex flex-wrap items-center justify-center gap-3">
            <button
              type="button"
              onClick={() => {
                router.back();
              }}
              className="block rounded-lg bg-indigo-600 px-4 py-2 font-medium text-white duration-150 hover:bg-indigo-500 active:bg-indigo-700"
            >
              {t[404].CTA}
            </button>
            <Link
              href="/"
              className="block rounded-lg border px-4 py-2 font-medium text-neutral-700 duration-150 hover:bg-neutral-50 active:bg-neutral-100"
            >
              {t[404].home}
            </Link>
          </div>
        </div>
      </div>
    </main>
  );
}
