fix(layout): handle localized routes in page title logic
This commit is contained in:
@@ -14,7 +14,10 @@ const Layout: React.FC<LayoutProps> = ({ children }) => {
|
||||
const pathname = usePathname();
|
||||
|
||||
const getPageTitle = (path: string) => {
|
||||
if (path === "/") return "Overview";
|
||||
const pathSegments = path.split("/").filter(Boolean);
|
||||
|
||||
if (pathSegments.length <= 1) return "Overview";
|
||||
const purePath = `/${pathSegments.slice(1).join("/")}`;
|
||||
|
||||
const titles: Record<string, string> = {
|
||||
"/users": "Users",
|
||||
@@ -24,7 +27,8 @@ const Layout: React.FC<LayoutProps> = ({ children }) => {
|
||||
"/events": "Worship & Events",
|
||||
};
|
||||
|
||||
return titles[path] || "Dashboard";
|
||||
return titles[purePath] || "Dashboard";
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user