import { PageProps } from "../validations/translations/translation";

// Language dictionary for internationalization
const languageDictionary = {
  en: {
    title: "Unauthorized Access",
    message1: "You do not have permission to access this page.",
    message2: "Please contact the administrator.",
    footer: `© ${new Date().getFullYear()} My Application`,
  },
  tr: {
    title: "Yetkisiz Erişim",
    message1: "Bu sayfaya erişim izniniz yok.",
    message2: "Lütfen yönetici ile iletişime geçin.",
    footer: `© ${new Date().getFullYear()} Uygulamam`,
  },
};

export const UnAuthorizedPage: React.FC<PageProps> = ({
  lang = "en",
  queryParams,
}) => {
  // Use the language dictionary based on the lang prop, defaulting to English
  const t =
    languageDictionary[lang as keyof typeof languageDictionary] ||
    languageDictionary.en;
  return (
    <>
      <div className="flex flex-col h-screen">
        <header className="bg-gray-800 text-white p-4 text-center">
          <h1 className="text-2xl font-bold">{t.title}</h1>
        </header>
        <main className="flex-grow p-4 bg-gray-100">
          <p className="text-gray-700">{t.message1}</p>
          <p className="text-gray-700">{t.message2}</p>
        </main>
        <footer className="bg-gray-800 text-white p-4 text-center">
          <p>{t.footer}</p>
        </footer>
      </div>
    </>
  );
};
