feat(ui): add Yachts entry to sidebar navigation
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
Users,
|
Users,
|
||||||
Bookmark,
|
Bookmark,
|
||||||
Anchor,
|
Anchor,
|
||||||
|
Ship,
|
||||||
Receipt,
|
Receipt,
|
||||||
FileText,
|
FileText,
|
||||||
FolderOpen,
|
FolderOpen,
|
||||||
@@ -30,12 +31,7 @@ import { Badge } from '@/components/ui/badge';
|
|||||||
import { Separator } from '@/components/ui/separator';
|
import { Separator } from '@/components/ui/separator';
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
|
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
|
||||||
import {
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
||||||
Tooltip,
|
|
||||||
TooltipContent,
|
|
||||||
TooltipProvider,
|
|
||||||
TooltipTrigger,
|
|
||||||
} from '@/components/ui/tooltip';
|
|
||||||
import type { UserPortRole } from '@/lib/db/schema/users';
|
import type { UserPortRole } from '@/lib/db/schema/users';
|
||||||
import type { Role } from '@/lib/db/schema/users';
|
import type { Role } from '@/lib/db/schema/users';
|
||||||
|
|
||||||
@@ -65,6 +61,7 @@ function buildNavSections(portSlug: string | undefined): NavSection[] {
|
|||||||
items: [
|
items: [
|
||||||
{ href: `${base}/dashboard`, label: 'Dashboard', icon: LayoutDashboard },
|
{ href: `${base}/dashboard`, label: 'Dashboard', icon: LayoutDashboard },
|
||||||
{ href: `${base}/clients`, label: 'Clients', icon: Users },
|
{ href: `${base}/clients`, label: 'Clients', icon: Users },
|
||||||
|
{ href: `${base}/yachts`, label: 'Yachts', icon: Ship },
|
||||||
{ href: `${base}/interests`, label: 'Interests', icon: Bookmark },
|
{ href: `${base}/interests`, label: 'Interests', icon: Bookmark },
|
||||||
{ href: `${base}/berths`, label: 'Berths', icon: Anchor },
|
{ href: `${base}/berths`, label: 'Berths', icon: Anchor },
|
||||||
],
|
],
|
||||||
@@ -280,7 +277,8 @@ export function Sidebar({ portRoles }: SidebarProps) {
|
|||||||
|
|
||||||
// Check for admin access based on role permissions
|
// Check for admin access based on role permissions
|
||||||
const hasAdminAccess = portRoles.some(
|
const hasAdminAccess = portRoles.some(
|
||||||
(pr) => pr.role?.permissions?.admin?.manage_users || pr.role?.permissions?.admin?.manage_settings,
|
(pr) =>
|
||||||
|
pr.role?.permissions?.admin?.manage_users || pr.role?.permissions?.admin?.manage_settings,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user