updated template
This commit is contained in:
parent
da95b629ac
commit
71822681f2
|
|
@ -2,34 +2,30 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Template from "@/components/Pages/template/app";
|
import Template from "@/components/Pages/template/app";
|
||||||
import ClientMenu from "@/components/menuCleint/menu";
|
import ClientMenu from "@/components/menuCleint/menu";
|
||||||
import { LanguageKey } from "@/components/Pages/template/language";
|
import {
|
||||||
|
getTranslation,
|
||||||
|
LanguageKey,
|
||||||
|
} from "@/components/Pages/template/language";
|
||||||
import { retrievePageList } from "@/apicalls/cookies/token";
|
import { retrievePageList } from "@/apicalls/cookies/token";
|
||||||
|
|
||||||
interface TemplatePageProps {
|
interface TemplatePageProps {
|
||||||
params: { lang?: string };
|
|
||||||
searchParams: { [key: string]: string | string[] | undefined };
|
searchParams: { [key: string]: string | string[] | undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
async function TemplatePage({ params, searchParams }: TemplatePageProps) {
|
async function TemplatePage({ searchParams }: TemplatePageProps) {
|
||||||
// Get language from query params or default to 'en'
|
// Get language from query params or default to 'en'
|
||||||
const pParams = await params;
|
|
||||||
const siteUrlsList = (await retrievePageList()) || [];
|
const siteUrlsList = (await retrievePageList()) || [];
|
||||||
const searchParamsInstance = await searchParams;
|
const searchParamsInstance = await searchParams;
|
||||||
const activePage = "/template";
|
|
||||||
const lang = (searchParamsInstance?.lang as LanguageKey) || "en";
|
const lang = (searchParamsInstance?.lang as LanguageKey) || "en";
|
||||||
|
const t = getTranslation(lang);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<>
|
<>
|
||||||
<div className="min-h-screen min-w-screen flex w-full">
|
<div className="min-h-screen min-w-screen flex w-full">
|
||||||
{/* Sidebar */}
|
{/* Sidebar */}
|
||||||
<aside className="w-1/4 border-r p-4 overflow-y-auto h-screen sticky top-0">
|
<aside className="w-1/4 border-r p-4 overflow-y-auto h-screen sticky top-0">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<ClientMenu
|
<ClientMenu siteUrls={siteUrlsList} lang={lang} />
|
||||||
siteUrls={siteUrlsList}
|
|
||||||
lang={lang}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
|
@ -37,11 +33,11 @@ async function TemplatePage({ params, searchParams }: TemplatePageProps) {
|
||||||
<div className="flex flex-col w-3/4 overflow-y-auto">
|
<div className="flex flex-col w-3/4 overflow-y-auto">
|
||||||
{/* Sticky Header */}
|
{/* Sticky Header */}
|
||||||
<header className="sticky top-0 bg-white shadow-md z-10 p-4 flex justify-between items-center">
|
<header className="sticky top-0 bg-white shadow-md z-10 p-4 flex justify-between items-center">
|
||||||
<h1 className="text-2xl font-semibold">{activePage}</h1>
|
<h1 className="text-2xl font-semibold">{t.title}</h1>
|
||||||
<div className="flex items-center space-x-4">
|
<div className="flex items-center space-x-4">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search..."
|
placeholder={t.search}
|
||||||
className="border px-3 py-2 rounded-lg"
|
className="border px-3 py-2 rounded-lg"
|
||||||
/>
|
/>
|
||||||
<div className="w-10 h-10 bg-gray-300 rounded-full"></div>
|
<div className="w-10 h-10 bg-gray-300 rounded-full"></div>
|
||||||
|
|
@ -53,7 +49,6 @@ async function TemplatePage({ params, searchParams }: TemplatePageProps) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from "react";
|
||||||
import { getTranslation, LanguageKey } from './language';
|
import { getTranslation, LanguageKey } from "./language";
|
||||||
|
|
||||||
interface ActionButtonsComponentProps {
|
interface ActionButtonsComponentProps {
|
||||||
onCreateClick: () => void;
|
onCreateClick: () => void;
|
||||||
|
|
@ -8,19 +8,23 @@ interface ActionButtonsComponentProps {
|
||||||
|
|
||||||
export function ActionButtonsComponent({
|
export function ActionButtonsComponent({
|
||||||
onCreateClick,
|
onCreateClick,
|
||||||
lang = 'en'
|
lang = "en",
|
||||||
}: ActionButtonsComponentProps) {
|
}: ActionButtonsComponentProps) {
|
||||||
const t = getTranslation(lang);
|
const t = getTranslation(lang);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-end mb-4">
|
<div className="bg-white p-4 rounded-lg shadow mb-4">
|
||||||
|
<div className="flex items-center space-x-2">
|
||||||
|
<label className="text-sm font-medium">{t.actions}</label>
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={onCreateClick}
|
onClick={onCreateClick}
|
||||||
className="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"
|
className="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600"
|
||||||
>
|
>
|
||||||
{t.create}
|
{t.create}
|
||||||
</button>
|
</button>
|
||||||
{/* Additional action buttons can be added here in the future */}
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,6 @@ function TemplateApp({ lang = "en" }: TemplateProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto px-4 py-6">
|
<div className="container mx-auto px-4 py-6">
|
||||||
<h1 className="text-2xl font-bold mb-6">{t.title}</h1>
|
|
||||||
|
|
||||||
{/* Search Component */}
|
{/* Search Component */}
|
||||||
{mode === "list" && (
|
{mode === "list" && (
|
||||||
<SearchComponent
|
<SearchComponent
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ const language = {
|
||||||
showing: "Showing",
|
showing: "Showing",
|
||||||
items: "items",
|
items: "items",
|
||||||
total: "Total",
|
total: "Total",
|
||||||
// Search related translations
|
|
||||||
search: "Search",
|
search: "Search",
|
||||||
searchPlaceholder: "Enter search term...",
|
searchPlaceholder: "Enter search term...",
|
||||||
searchFields: "Search in fields",
|
searchFields: "Search in fields",
|
||||||
|
|
@ -43,6 +42,51 @@ const language = {
|
||||||
create: "Create",
|
create: "Create",
|
||||||
save: "Save",
|
save: "Save",
|
||||||
},
|
},
|
||||||
|
actions: "Actions",
|
||||||
|
},
|
||||||
|
tr: {
|
||||||
|
title: "Veri Yönetimi",
|
||||||
|
create: "Yeni Oluştur",
|
||||||
|
view: "Görüntüle",
|
||||||
|
update: "Güncelle",
|
||||||
|
createNew: "Yeni Oluştur",
|
||||||
|
back: "Geri",
|
||||||
|
cancel: "İptal",
|
||||||
|
submit: "Gönder",
|
||||||
|
noItemsFound: "Hiçbir kayıt bulunamadı",
|
||||||
|
previous: "Önceki",
|
||||||
|
next: "Sonraki",
|
||||||
|
page: "Sayfa",
|
||||||
|
of: "of",
|
||||||
|
itemsPerPage: "Sayfa başına kayıt:",
|
||||||
|
sortBy: "Sırala:",
|
||||||
|
loading: "Yükleniyor...",
|
||||||
|
error: "Veri yüklenirken hata:",
|
||||||
|
showing: "Gösteriliyor",
|
||||||
|
items: "kayıtlar",
|
||||||
|
total: "Toplam",
|
||||||
|
search: "Ara",
|
||||||
|
searchPlaceholder: "Ara...",
|
||||||
|
searchFields: "Ara alanları",
|
||||||
|
activeSearch: "Aktif arama",
|
||||||
|
clearSearch: "Temizle",
|
||||||
|
formLabels: {
|
||||||
|
title: "Başlık",
|
||||||
|
description: "Açıklama",
|
||||||
|
status: "Durum",
|
||||||
|
createdAt: "Oluşturulma",
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
active: "Aktif",
|
||||||
|
inactive: "Pasif",
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
view: "Görüntüle",
|
||||||
|
update: "Güncelle",
|
||||||
|
create: "Oluştur",
|
||||||
|
save: "Kaydet",
|
||||||
|
},
|
||||||
|
actions: "Eylemler",
|
||||||
},
|
},
|
||||||
// Add more languages as needed
|
// Add more languages as needed
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue