import React from "react"; import { useRouter } from "next/router"; import Link from "next/link"; export const SettingsSidebar = () => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; const projectLinks: Array<{ label: string; href: string; }> = [ { label: "General", href: `/${workspaceSlug}/projects/${projectId}/settings`, }, { label: "Members", href: `/${workspaceSlug}/projects/${projectId}/settings/members`, }, { label: "Features", href: `/${workspaceSlug}/projects/${projectId}/settings/features`, }, { label: "States", href: `/${workspaceSlug}/projects/${projectId}/settings/states`, }, { label: "Labels", href: `/${workspaceSlug}/projects/${projectId}/settings/labels`, }, { label: "Integrations", href: `/${workspaceSlug}/projects/${projectId}/settings/integrations`, }, { label: "Estimates", href: `/${workspaceSlug}/projects/${projectId}/settings/estimates`, }, { label: "Automations", href: `/${workspaceSlug}/projects/${projectId}/settings/automations`, }, ]; const workspaceLinks: Array<{ label: string; href: string; }> = [ { label: "General", href: `/${workspaceSlug}/settings`, }, { label: "Members", href: `/${workspaceSlug}/settings/members`, }, { label: "Billing & Plans", href: `/${workspaceSlug}/settings/billing`, }, { label: "Integrations", href: `/${workspaceSlug}/settings/integrations`, }, { label: "Imports", href: `/${workspaceSlug}/settings/imports`, }, { label: "Exports", href: `/${workspaceSlug}/settings/exports`, }, ]; const profileLinks: Array<{ label: string; href: string; }> = [ { label: "Profile", href: `/${workspaceSlug}/me/profile`, }, { label: "Activity", href: `/${workspaceSlug}/me/profile/activity`, }, { label: "Preferences", href: `/${workspaceSlug}/me/profile/preferences`, }, ]; return (
SETTINGS
{(projectId ? projectLinks : workspaceLinks).map((link) => (
{link.label}
))}
{!projectId && (
My Account
{profileLinks.map((link) => (
{link.label}
))}
)}
); };