import React from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { Layout } from "@/components/Layout"; import { NavLink } from "@/components/NavLink"; import { UserCircle, Sliders, Database, Link2, Wand2, Tag, Store, Repeat, List, KeyRound } from "lucide-react"; const tabs = [ { label: "Account", to: "/settings/account", icon: UserCircle }, { label: "Preferences", to: "/settings/preferences", icon: Sliders }, { label: "Data Sources", to: "/settings/sources", icon: Database }, { label: "Brokerages", to: "/settings/brokerages", icon: Link2 }, { label: "Rules", to: "/settings/rules", icon: Wand2 }, { label: "Tags", to: "/settings/tags", icon: Tag }, { label: "Merchants", to: "/settings/merchants", icon: Store }, { label: "Recurring", to: "/settings/recurring", icon: Repeat }, { label: "Categories", to: "/settings/categories", icon: List }, { label: "API Access", to: "/settings/api-access", icon: KeyRound }, ]; /** * Shared shell for the /settings/* pages: a single "Settings" header plus a tab * row, so the previously disconnected settings routes read as one coherent area. */ export function SettingsLayout({ children }: { children: React.ReactNode }) { const navigate = useNavigate(); const { pathname } = useLocation(); // "/settings" itself shows Account; unknown subpaths fall back to it too. const current = tabs.find((t) => pathname === t.to || pathname.startsWith(`${t.to}/`))?.to ?? tabs[0].to; return (

Settings

Manage your account, data connections, and preferences

{/* Below lg the ten tabs can't fit and a hidden-scrollbar strip hid the last ones; a native select is always reachable and works with a thumb. From lg up the tabs wrap onto a second row instead of scrolling. */}
{children}
); }