managment frontend initiated
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
import React from "react";
|
||||
|
||||
const EventAppendPage: React.FC<PageProps> = () => {
|
||||
return <div>EventAppendPage</div>;
|
||||
};
|
||||
|
||||
export default EventAppendPage;
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
|
||||
const AppendersServicePage: React.FC<PageProps> = () => {
|
||||
return <div>AppendersServicePage</div>;
|
||||
};
|
||||
|
||||
export default AppendersServicePage;
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
|
||||
const ApplicationPage: React.FC<PageProps> = () => {
|
||||
return <div>ApplicationPage</div>;
|
||||
};
|
||||
|
||||
export default ApplicationPage;
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
|
||||
const DashboardPage: React.FC<PageProps> = () => {
|
||||
return <div>DashboardPage</div>;
|
||||
};
|
||||
|
||||
export default DashboardPage;
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
|
||||
const EmployeePage: React.FC<PageProps> = () => {
|
||||
return <div>EmployeePage</div>;
|
||||
};
|
||||
|
||||
export default EmployeePage;
|
||||
@@ -0,0 +1,15 @@
|
||||
import EventAppendPage from "@/components/Pages/appenderEvent/page";
|
||||
import AppendersServicePage from "./appendersService/page";
|
||||
import ApplicationPage from "./application/page";
|
||||
import EmployeePage from "./employee/page";
|
||||
import OcuppantPage from "./ocuppant/page";
|
||||
import DashboardPage from "./dashboard/page";
|
||||
|
||||
export const menuPages = {
|
||||
"/dashboard": DashboardPage,
|
||||
"/append/event": EventAppendPage,
|
||||
"/append/service": AppendersServicePage,
|
||||
"/application": ApplicationPage,
|
||||
"/employee": EmployeePage,
|
||||
"/ocuppant": OcuppantPage,
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from "react";
|
||||
import { PageProps } from "@/components/validations/translations/translation";
|
||||
|
||||
const OcuppantPage: React.FC<PageProps> = () => {
|
||||
return <div>OcuppantPage</div>;
|
||||
};
|
||||
|
||||
export default OcuppantPage;
|
||||
@@ -0,0 +1,10 @@
|
||||
import { menuPages } from ".";
|
||||
import { PageProps } from "../validations/translations/translation";
|
||||
import { UnAuthorizedPage } from "./unauthorizedpage";
|
||||
|
||||
export function retrievePageByUrl(url: string): React.FC<PageProps> {
|
||||
if (url in menuPages) {
|
||||
return menuPages[url as keyof typeof menuPages];
|
||||
}
|
||||
return UnAuthorizedPage;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user