Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
255d39a2d7
commit
4715dcc4f7
@@ -0,0 +1,50 @@
|
||||
import { createFileRoute, Link, useLocation } from "@tanstack/react-router";
|
||||
import { ProtectedLayout } from "@/components/protected-layout";
|
||||
import { PageContainer, PageHeader } from "@/components/app-shell";
|
||||
import { Outlet } from "@tanstack/react-router";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export const Route = createFileRoute("/settings")({
|
||||
component: SettingsLayout,
|
||||
});
|
||||
|
||||
const TABS = [
|
||||
{ to: "/settings", label: "Company", exact: true },
|
||||
{ to: "/settings/fees", label: "Fee schedule" },
|
||||
];
|
||||
|
||||
function SettingsLayout() {
|
||||
const location = useLocation();
|
||||
return (
|
||||
<ProtectedLayout adminOnly>
|
||||
<PageContainer>
|
||||
<PageHeader
|
||||
title="Settings"
|
||||
description="Configure firm-wide information and billing defaults."
|
||||
/>
|
||||
<div className="flex gap-1 border-b mb-6">
|
||||
{TABS.map((t) => {
|
||||
const active = t.exact
|
||||
? location.pathname === t.to
|
||||
: location.pathname.startsWith(t.to);
|
||||
return (
|
||||
<Link
|
||||
key={t.to}
|
||||
to={t.to}
|
||||
className={cn(
|
||||
"px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",
|
||||
active
|
||||
? "border-primary text-foreground"
|
||||
: "border-transparent text-muted-foreground hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
{t.label}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<Outlet />
|
||||
</PageContainer>
|
||||
</ProtectedLayout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user