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';
|
|
|
|
|
|
2026-05-04 22:54:06 +02:00
|
|
|
import { Plus } from 'lucide-react';
|
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 { 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 { Breadcrumbs } from '@/components/layout/breadcrumbs';
|
2026-03-26 12:06:18 +01:00
|
|
|
import { CommandSearch } from '@/components/search/command-search';
|
2026-05-04 22:54:06 +02:00
|
|
|
import { Inbox } from '@/components/layout/inbox';
|
|
|
|
|
import { UserMenu } from '@/components/layout/user-menu';
|
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 type { Port } from '@/lib/db/schema/ports';
|
|
|
|
|
|
|
|
|
|
interface TopbarProps {
|
|
|
|
|
ports: Port[];
|
2026-04-27 23:54:04 +02:00
|
|
|
user?: { name: string; email: string };
|
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
|
|
|
}
|
|
|
|
|
|
2026-04-27 23:54:04 +02:00
|
|
|
export function Topbar({ ports, user }: TopbarProps) {
|
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
|
|
|
const router = useRouter();
|
|
|
|
|
const currentPortSlug = useUIStore((s) => s.currentPortSlug);
|
|
|
|
|
const base = currentPortSlug ? `/${currentPortSlug}` : '';
|
|
|
|
|
|
|
|
|
|
return (
|
2026-05-04 22:54:06 +02:00
|
|
|
// Three-column grid: breadcrumbs left, search center, actions right.
|
|
|
|
|
// The brand logo lives in the sidebar header (per design feedback) so the
|
|
|
|
|
// topbar center is dedicated to the global search bar.
|
|
|
|
|
<header className="grid h-14 grid-cols-[minmax(0,1fr)_minmax(360px,640px)_minmax(0,1fr)] items-center border-b border-border bg-background gap-3 px-4 shrink-0">
|
|
|
|
|
{/* LEFT: breadcrumbs / page title */}
|
|
|
|
|
<div className="min-w-0">
|
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
|
|
|
<Breadcrumbs />
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-05-04 22:54:06 +02:00
|
|
|
{/* CENTER: global search - capped width and horizontally centered
|
|
|
|
|
inside its grid slot so it sits visually in the middle of the
|
|
|
|
|
topbar regardless of breadcrumb / action-row width. */}
|
|
|
|
|
<div className="flex items-center justify-center min-w-0">
|
|
|
|
|
<div className="w-full max-w-md mx-auto min-w-0">
|
|
|
|
|
<CommandSearch />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
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
|
|
|
|
2026-05-04 22:54:06 +02:00
|
|
|
{/* RIGHT: action row */}
|
|
|
|
|
<div className="flex items-center gap-2 shrink-0 justify-end">
|
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 dropdown */}
|
|
|
|
|
<DropdownMenu>
|
|
|
|
|
<DropdownMenuTrigger asChild>
|
2026-04-28 12:10:11 +02:00
|
|
|
<Button
|
|
|
|
|
size="sm"
|
|
|
|
|
className="bg-gradient-brand hover:opacity-90 text-white gap-1.5 shadow-sm transition-all duration-base ease-smooth hover:scale-[1.02]"
|
|
|
|
|
>
|
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
|
|
|
<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>
|
|
|
|
|
|
2026-05-04 22:54:06 +02:00
|
|
|
{/* Unified inbox - combines system alerts (operational) and personal
|
|
|
|
|
notifications (user-targeted) into a single bell with two tabs.
|
|
|
|
|
Replaces the previous AlertBell + NotificationBell pair. */}
|
|
|
|
|
<Inbox />
|
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
|
|
|
|
|
|
|
|
<Separator orientation="vertical" className="h-6" />
|
|
|
|
|
|
2026-05-04 22:54:06 +02:00
|
|
|
{/* User menu - single source of truth for the profile dropdown.
|
|
|
|
|
Same component is mounted in the sidebar footer so the menu
|
|
|
|
|
items (incl. port switcher) stay consistent across triggers. */}
|
|
|
|
|
<UserMenu
|
|
|
|
|
align="end"
|
|
|
|
|
user={user}
|
|
|
|
|
ports={ports}
|
|
|
|
|
trigger={
|
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
|
|
|
<Button variant="ghost" size="icon" className="rounded-full">
|
2026-04-28 12:24:14 +02:00
|
|
|
<Avatar className="w-7 h-7 shadow-sm ring-2 ring-background">
|
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
|
|
|
<AvatarImage src={undefined} />
|
|
|
|
|
<AvatarFallback className="bg-brand text-white text-xs font-semibold">
|
2026-04-27 23:54:04 +02:00
|
|
|
{(user?.name ?? 'U').slice(0, 1).toUpperCase()}
|
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
|
|
|
</AvatarFallback>
|
|
|
|
|
</Avatar>
|
|
|
|
|
</Button>
|
2026-05-04 22:54:06 +02:00
|
|
|
}
|
|
|
|
|
/>
|
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
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
);
|
|
|
|
|
}
|