- New PageHeader component (variant D — grouped icon-pill toolbar): big title + muted description on the left, Support / Docs / Changelog as a 3-icon segmented pill on the right with tooltips. External links open in a new tab. - BasePage / BasePageWithStates / MonitorBasePageWithStates accept a headerKey prop; when set, render PageHeader pulling pages.<headerKey>.header.title and .description from i18n. When unset, falls back to the existing breadcrumb (no behavior change for not-yet-migrated pages). - All top-level pages (uptime, infrastructure, pageSpeed, notifications, maintenance, statusPages, incidents, logs, checks, account, settings) now pass their headerKey. - Sidebar: removed the bottom menu (Support / Discussions / Docs / Changelog) since those links now live in the page header.
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { BasePage, Tabs, Tab } from "@/Components/design-elements";
|
|
import { useState, useEffect } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { TabProfile } from "./TabProfile";
|
|
import { TabPassword } from "./TabPassword";
|
|
import { TabTeam } from "./TabTeam";
|
|
|
|
interface AccountProps {
|
|
open?: "profile" | "password" | "team";
|
|
}
|
|
|
|
const TAB_MAP = {
|
|
profile: 0,
|
|
password: 1,
|
|
team: 2,
|
|
} as const;
|
|
|
|
const Account = ({ open = "profile" }: AccountProps) => {
|
|
const { t } = useTranslation();
|
|
const [activeTab, setActiveTab] = useState<number>(TAB_MAP[open]);
|
|
|
|
// Sync activeTab when open prop changes (e.g., navigating from sidebar)
|
|
useEffect(() => {
|
|
setActiveTab(TAB_MAP[open]);
|
|
}, [open]);
|
|
|
|
return (
|
|
<BasePage headerKey="account">
|
|
<Tabs
|
|
value={activeTab}
|
|
onChange={(_, newValue: number) => setActiveTab(newValue)}
|
|
>
|
|
<Tab label={t("pages.account.tabs.profile")} />
|
|
<Tab label={t("pages.account.tabs.password")} />
|
|
<Tab label={t("pages.account.tabs.team")} />
|
|
</Tabs>
|
|
{activeTab === 0 && <TabProfile />}
|
|
{activeTab === 1 && <TabPassword />}
|
|
{activeTab === 2 && <TabTeam />}
|
|
</BasePage>
|
|
);
|
|
};
|
|
|
|
export default Account;
|