"use client"; import { useState, useEffect } from "react"; import { PageHeader, AdminFilterTabs } from "@/components/admin/design-system"; type Tab = "general" | "addons" | "billing" | "integrations" | "ai" | "advanced"; const TABS: { id: Tab; label: string }[] = [ { id: "general", label: "General" }, { id: "addons", label: "Add-ons" }, { id: "billing", label: "Billing" }, { id: "integrations", label: "Integrations" }, { id: "ai", label: "AI" }, { id: "advanced", label: "Advanced" }, ]; type Props = { brandId: string; }; export default function SettingsClient({ brandId }: Props) { const [activeTab, setActiveTab] = useState("general"); // Handle URL hash for navigation useEffect(() => { const hash = window.location.hash.slice(1); const matchingTab = TABS.find(t => t.id === hash); if (matchingTab) { setActiveTab(matchingTab.id); } }, []); // Content for each tab - links to full pages const renderContent = () => { switch (activeTab) { case "general": return (

Workers, Tasks & Users

Manage time tracking workers, tasks, and user permissions

Open Settings
); case "addons": return (

Feature Add-ons

Enable features to extend your platform capabilities

Open Add-ons
); case "billing": return (

Billing & Plans

Manage your subscription, invoices, and usage

Open Billing
); case "integrations": return (

Integrations

Configure Stripe, Square, shipping, and other integrations

Open Integrations
); case "ai": return (

AI Settings

Configure AI provider settings for intelligent automation

Open AI Settings
); case "advanced": return (

Advanced Settings

Developer settings, APIs, webhooks, and integrations

Open Advanced
); default: return null; } }; return (
{/* Page Header */}
} /> {/* Tab navigation */}
setActiveTab(tab as Tab)} tabs={TABS.map(tab => ({ value: tab.id, label: tab.label }))} size="md" />
{/* Content */}
{renderContent()}
); }