Improve admin UX: hub i18n, dynamic topbar, settings strings, staff logs DataTable.
Local Build and Deploy / deploy (push) Successful in 1m12s
Local Build and Deploy / deploy (push) Successful in 1m12s
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
604e63da51
commit
1039044e48
11 files changed
+526
-305
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useTranslations } from "next-intl";
|
||||
import type { ReactNode } from "react";
|
||||
import { AdminPageShell } from "@/components/admin/admin-page-shell";
|
||||
import { AdminSectionTabs } from "@/components/admin/admin-section-tabs";
|
||||
@@ -13,15 +14,23 @@ import { findAdminHub } from "@/lib/admin-nav";
|
||||
export function AdminHubChrome({ children }: { children: ReactNode }) {
|
||||
const pathname = usePathname() ?? "";
|
||||
const hub = findAdminHub(pathname);
|
||||
const t = useTranslations("pages.admin.hubs");
|
||||
|
||||
if (!hub) return <>{children}</>;
|
||||
|
||||
const tabs = hub.tabs.map((tab) => ({
|
||||
href: tab.href,
|
||||
label: t(`tabs.${tab.labelKey}`),
|
||||
match: tab.match,
|
||||
group: tab.group,
|
||||
}));
|
||||
|
||||
return (
|
||||
<AdminPageShell
|
||||
icon={hub.icon}
|
||||
title={hub.title}
|
||||
subtitle={hub.subtitle}
|
||||
tabs={<AdminSectionTabs tabs={hub.tabs} />}
|
||||
title={t(hub.titleKey)}
|
||||
subtitle={t(hub.subtitleKey)}
|
||||
tabs={<AdminSectionTabs tabs={tabs} />}
|
||||
className="admin-hub-panel"
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in new issue
Block a user