"use client"; import * as React from "react"; import { Inbox, LayoutDashboard, Link2, Package, Send, Settings, Wallet, } from "lucide-react"; import Link from "next/link"; import { Logo } from "@/components/logo"; import { NavMain } from "@/components/nav-main"; import { NavUser } from "@/components/nav-user"; import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from "@/components/ui/sidebar"; import type { ShellCompany, ShellUser } from "@/app/(dashboard)/dashboard-shell"; type NavItem = { title: string; url: string; icon?: typeof LayoutDashboard; }; type NavGroup = { label: string; items: NavItem[]; }; function buildNavGroups(kind: ShellCompany["kind"]): NavGroup[] { const isLab = kind === "lab"; const operationsItems: NavItem[] = [ { title: "Gelen İşler", url: "/jobs/inbound", icon: Inbox }, { title: "Giden İşler", url: "/jobs/outbound", icon: Send }, ]; if (isLab) { operationsItems.push({ title: "Ürünler", url: "/products", icon: Package }); } return [ { label: "Genel", items: [{ title: "Anasayfa", url: "/dashboard", icon: LayoutDashboard }], }, { label: "Operasyon", items: operationsItems, }, { label: "Finans", items: [{ title: "Finans", url: "/finance", icon: Wallet }], }, { label: "Hesap", items: [ { title: "Bağlantı Kur", url: "/connections", icon: Link2 }, { title: "Ayarlar", url: "/settings/workspace", icon: Settings }, ], }, ]; } export function AppSidebar({ user, company, ...props }: React.ComponentProps & { user: ShellUser; company: ShellCompany; }) { const navGroups = buildNavGroups(company.kind); return ( {company.logoUrl ? (
{/* eslint-disable-next-line @next/next/no-img-element */} {`${company.name}
) : (
)}
DLS {company.name}
{navGroups.map((group) => ( ))}
); }