Files
supabase/apps/studio/components/layouts/AccountLayout/AccountSettingsLayout.tsx
Joshen Lim fd98a08a4f Chore/default to new organization layout (#35515)
* Default to new organization layout + remove feature preview

* Remove feature preview

* Clean up LayoutUpdateBanner

* Clean up

* Fix

* Fixy fix

* Update comment

* Nit to fix layout shift
2025-05-13 11:25:35 +08:00

59 lines
1.6 KiB
TypeScript

import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { PropsWithChildren } from 'react'
import { Button, cn } from 'ui'
import { ScaffoldContainerLegacy } from '../Scaffold'
export const AccountSettingsLayout = ({ children }: PropsWithChildren) => {
const pathname = usePathname()
const links = [
{
isActive: pathname === `/account/me`,
label: 'Preferences',
href: `/account/me`,
key: `/account/me`,
},
{
isActive: pathname === `/account/tokens`,
label: 'Access Tokens',
href: `/account/tokens`,
key: `/account/tokens`,
},
{
isActive: pathname === `/account/security`,
label: 'Security',
href: `/account/security`,
key: `/account/security`,
},
]
return (
<ScaffoldContainerLegacy className="flex flex-row py-8 gap-20">
<nav className="py-0">
<ul className="flex flex-col gap-1">
{links.map((link, i) => (
<li key={`${link.key}-${i}`}>
<Link href={link.href}>
<Button
type={link.isActive ? 'default' : 'text'}
className={cn(
'border-0',
link.isActive
? 'bg-selection text-foreground'
: 'hover:bg-overlay-hover text-foreground-lighter'
)}
>
{link.label}
</Button>
</Link>
</li>
))}
</ul>
</nav>
<div className="flex-1 flex-grow">{children}</div>
</ScaffoldContainerLegacy>
)
}