updated app reachable codes

This commit is contained in:
2025-04-09 11:51:28 +03:00
parent 7eadadbd1d
commit 7c2150a8b0
23 changed files with 1040 additions and 187 deletions

View File

@@ -0,0 +1,41 @@
import { PageProps } from "./interFaces";
import Page0001 from "./page0001";
const PageIndexs = {
"6015129b-f665-479c-a440-04fb82ea6114": Page0001,
};
function UnAuthorizedPage({ lang }: PageProps) {
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">Unauthorized Access</h1>
</header>
<main className="flex-grow p-4 bg-gray-100">
<p className="text-gray-700">
You do not have permission to access this page.
</p>
<p className="text-gray-700">Please contact the administrator.</p>
</main>
<footer className="bg-gray-800 text-white p-4 text-center">
<p>&copy; 2023 My Application</p>
</footer>
</div>
</>
);
}
export function retrievePage({
pageId,
}: {
pageId: string;
}): React.ComponentType<PageProps> {
const PageComponent = PageIndexs[pageId as keyof typeof PageIndexs];
if (!PageComponent) {
return UnAuthorizedPage;
}
return PageComponent;
}
export default retrievePage;

View File

@@ -0,0 +1,3 @@
export interface PageProps {
lang: string;
}

View File

@@ -0,0 +1,36 @@
import React from "react";
import { PageProps } from "./interFaces";
const pageContext = {
tr: {
pageTitle: "Sayfa 0001",
pageDescription: "Bu, Sayfa 0001'in içeriğidir.",
},
en: {
pageTitle: "Page 0001",
pageDescription: "This is the content of Page 0001.",
},
};
function Page0001({ lang }: PageProps) {
const { pageTitle, pageDescription } =
pageContext[lang as keyof typeof pageContext];
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">{pageTitle}</h1>
</header>
<main className="flex-grow p-4 bg-gray-100">
<p className="text-gray-700">{pageDescription}</p>
</main>
<footer className="bg-gray-800 text-white p-4 text-center">
<p>&copy; 2023 My Application</p>
</footer>
</div>
</>
);
}
export default Page0001;