Files
supabase/apps/studio/components/layouts/SettingsLayout/OrganizationSettingsMenu.tsx
Alaister YoungandKevin Grüneberg 70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00

41 lines
1.4 KiB
TypeScript

import { useRouter } from 'next/router'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import SettingsMenuItem from './SettingsMenuItem'
const OrganizationSettingsMenu = () => {
const router = useRouter()
const organization = useSelectedOrganization()
const organizationSettings = [
{ label: 'General', pathname: `/org/[slug]/general` },
{ label: 'Members', pathname: `/org/[slug]/team` },
{ label: 'Integrations', pathname: `/org/[slug]/integrations` },
{ label: 'Billing', pathname: `/org/[slug]/billing` },
{ label: 'Usage', pathname: `/org/[slug]/usage` },
{ label: 'Invoices', pathname: `/org/[slug]/invoices` },
{ label: 'OAuth Apps', pathname: `/org/[slug]/apps` },
{ label: 'Audit Logs', pathname: `/org/[slug]/audit` },
{ label: 'Legal Documents', pathname: `/org/[slug]/documents` },
]
return (
<div className="space-y-10">
<div className="space-y-2">
<p className="text-sm font-medium">Organization</p>
{organizationSettings.map((link) => (
<SettingsMenuItem
key={link.label}
label={link.label}
href={
organization !== undefined ? link.pathname.replace('[slug]', organization.slug) : '/'
}
isActive={link.pathname === router.pathname}
/>
))}
</div>
</div>
)
}
export default OrganizationSettingsMenu