Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { Plus, Moon, Sun, LogOut, User, Settings } from 'lucide-react';
|
|
|
|
|
import { useRouter } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
import { useUIStore } from '@/stores/ui-store';
|
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
|
|
|
|
import { Separator } from '@/components/ui/separator';
|
|
|
|
|
import {
|
|
|
|
|
DropdownMenu,
|
|
|
|
|
DropdownMenuContent,
|
|
|
|
|
DropdownMenuItem,
|
|
|
|
|
DropdownMenuLabel,
|
|
|
|
|
DropdownMenuSeparator,
|
|
|
|
|
DropdownMenuTrigger,
|
|
|
|
|
} from '@/components/ui/dropdown-menu';
|
|
|
|
|
import { PortSwitcher } from '@/components/layout/port-switcher';
|
|
|
|
|
import { Breadcrumbs } from '@/components/layout/breadcrumbs';
|
2026-03-26 12:06:18 +01:00
|
|
|
import { CommandSearch } from '@/components/search/command-search';
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
import { NotificationBell } from '@/components/notifications/notification-bell';
|
|
|
|
|
import type { Port } from '@/lib/db/schema/ports';
|
|
|
|
|
|
|
|
|
|
interface TopbarProps {
|
|
|
|
|
ports: Port[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function Topbar({ ports }: TopbarProps) {
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const currentPortSlug = useUIStore((s) => s.currentPortSlug);
|
|
|
|
|
const darkMode = useUIStore((s) => s.darkMode);
|
|
|
|
|
const toggleDarkMode = useUIStore((s) => s.toggleDarkMode);
|
|
|
|
|
|
|
|
|
|
const base = currentPortSlug ? `/${currentPortSlug}` : '';
|
|
|
|
|
|
|
|
|
|
function handleToggleDarkMode() {
|
|
|
|
|
toggleDarkMode();
|
|
|
|
|
document.documentElement.classList.toggle('dark');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<header className="h-14 border-b border-border bg-background flex items-center gap-3 px-4 shrink-0">
|
|
|
|
|
{/* Breadcrumbs / page title */}
|
|
|
|
|
<div className="flex-1 min-w-0">
|
|
|
|
|
<Breadcrumbs />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Actions row */}
|
|
|
|
|
<div className="flex items-center gap-2 shrink-0">
|
|
|
|
|
{/* Global search — inline with dropdown results */}
|
|
|
|
|
<CommandSearch />
|
|
|
|
|
|
|
|
|
|
{/* Port switcher — hidden for single port */}
|
|
|
|
|
<PortSwitcher ports={ports} />
|
|
|
|
|
|
|
|
|
|
{/* + New dropdown */}
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger asChild>
|
|
|
|
|
<Button size="sm" className="bg-brand hover:bg-brand-500 text-white gap-1.5">
|
|
|
|
|
<Plus className="w-4 h-4" />
|
|
|
|
|
<span className="hidden sm:inline">New</span>
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
|
|
|
|
<DropdownMenuContent align="end" className="w-44">
|
|
|
|
|
<DropdownMenuLabel className="text-xs text-muted-foreground">Create</DropdownMenuLabel>
|
|
|
|
|
<DropdownMenuSeparator />
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/clients/new` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
New Client
|
|
|
|
|
</DropdownMenuItem>
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/interests/new` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
New Interest
|
|
|
|
|
</DropdownMenuItem>
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/expenses/new` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
New Expense
|
|
|
|
|
</DropdownMenuItem>
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/reminders/new` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
New Reminder
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
|
|
|
|
|
|
|
|
|
{/* Notification bell — real-time via socket */}
|
|
|
|
|
<NotificationBell />
|
|
|
|
|
|
|
|
|
|
<Separator orientation="vertical" className="h-6" />
|
|
|
|
|
|
|
|
|
|
{/* User menu */}
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger asChild>
|
|
|
|
|
<Button variant="ghost" size="icon" className="rounded-full">
|
|
|
|
|
<Avatar className="w-7 h-7">
|
|
|
|
|
<AvatarImage src={undefined} />
|
|
|
|
|
<AvatarFallback className="bg-brand text-white text-xs font-semibold">
|
|
|
|
|
U
|
|
|
|
|
</AvatarFallback>
|
|
|
|
|
</Avatar>
|
|
|
|
|
</Button>
|
|
|
|
|
</DropdownMenuTrigger>
|
|
|
|
|
<DropdownMenuContent align="end" className="w-52">
|
|
|
|
|
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
|
|
|
<DropdownMenuSeparator />
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/settings/profile` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
<User className="w-4 h-4 mr-2" />
|
|
|
|
|
Profile
|
|
|
|
|
</DropdownMenuItem>
|
2026-03-26 12:29:55 +01:00
|
|
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
|
|
|
<DropdownMenuItem onClick={() => router.push(`${base}/settings` as any)}>
|
Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM,
PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source
files covering clients, berths, interests/pipeline, documents/EOI,
expenses/invoices, email, notifications, dashboard, admin, and
client portal. CI/CD via Gitea Actions with Docker builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:51 +01:00
|
|
|
<Settings className="w-4 h-4 mr-2" />
|
|
|
|
|
Settings
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
<DropdownMenuSeparator />
|
|
|
|
|
<DropdownMenuItem onClick={handleToggleDarkMode}>
|
|
|
|
|
{darkMode ? (
|
|
|
|
|
<>
|
|
|
|
|
<Sun className="w-4 h-4 mr-2" />
|
|
|
|
|
Light Mode
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<Moon className="w-4 h-4 mr-2" />
|
|
|
|
|
Dark Mode
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
<DropdownMenuSeparator />
|
|
|
|
|
<DropdownMenuItem
|
|
|
|
|
className="text-destructive focus:text-destructive"
|
|
|
|
|
onClick={() => router.push('/api/auth/sign-out')}
|
|
|
|
|
>
|
|
|
|
|
<LogOut className="w-4 h-4 mr-2" />
|
|
|
|
|
Sign Out
|
|
|
|
|
</DropdownMenuItem>
|
|
|
|
|
</DropdownMenuContent>
|
|
|
|
|
</DropdownMenu>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|