Add next-intl to internationalize our project

This commit is contained in:
2026-02-03 15:11:59 +01:00
parent a073665dc4
commit 85b618836b
25 changed files with 1103 additions and 180 deletions

View File

@@ -0,0 +1,58 @@
"use client";
import Header from "@/components/Header/index";
import Sidebar from "@/components/Sidebar";
import React, { useState } from "react";
import { usePathname } from "next/navigation";
interface LayoutProps {
children: React.ReactNode;
}
const Layout: React.FC<LayoutProps> = ({ children }) => {
const [sidebarOpen, setSidebarOpen] = useState(false);
const pathname = usePathname();
const getPageTitle = (path: string) => {
if (path === "/") return "Overview";
const titles: Record<string, string> = {
"/users": "Users",
"/settings": "Settings",
"/profile": "Profile",
"/songs": "Songs Database",
"/events": "Worship & Events",
};
return titles[path] || "Dashboard";
};
return (
<div className="dashboard">
<Sidebar open={sidebarOpen} close={() => setSidebarOpen(false)} />
{/* Mobile Sidebar Overlay */}
{sidebarOpen && (
<div
className="fixed inset-0 z-40 bg-black/50 md:hidden"
onClick={() => setSidebarOpen(false)}
/>
)}
<div
className={`flex min-h-screen flex-col transition-all duration-300 md:pl-64`}
>
<Header
onMenuClick={() => setSidebarOpen(!sidebarOpen)}
pageTitle={getPageTitle(pathname)}
/>
<main className="animate-in fade-in flex-1 p-4 duration-500 md:p-8">
{children}
</main>
</div>
</div>
);
};
export default Layout;