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 { useRouter, useParams } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
import { DataTable } from '@/components/shared/data-table';
|
|
|
|
|
import { FilterBar } from '@/components/shared/filter-bar';
|
|
|
|
|
import { PageHeader } from '@/components/shared/page-header';
|
|
|
|
|
import { SavedViewsDropdown } from '@/components/shared/saved-views-dropdown';
|
|
|
|
|
import { EmptyState } from '@/components/shared/empty-state';
|
|
|
|
|
import { usePaginatedQuery } from '@/hooks/use-paginated-query';
|
|
|
|
|
import { useRealtimeInvalidation } from '@/hooks/use-realtime-invalidation';
|
feat(mobile): mobile cards for yachts, companies, berths, invoices, expenses
Five new <EntityCard> files using the shared <ListCard> shell, wired
into each list page's <DataTable> via cardRender. Desktop view
(lg+) is unchanged.
- YachtCard: Ship icon, owner subtitle (User/Building2 icon by
ownerType), dimensions in meters preferred, hull #,
status pill. No accent bar (status is free-text).
- CompanyCard: Building2 icon, legalName subtitle, country (MapPin)
+ tax id (Hash) meta, member/yacht count line.
- BerthCard: Anchor icon, area subtitle (MapPin), dimensions
meta, status pill. Status-encoded accent bar
(emerald=available, amber=under_offer, slate=sold).
- InvoiceCard: FileText icon, client subtitle, due date (Calendar)
meta, prominent currency-formatted amount. Status
accent bar (emerald=paid, orange=overdue, ...).
- ExpenseCard: Receipt icon, category subtitle, expense date meta,
prominent amount, payment-status pill, "Possible
duplicate" pill when duplicateOf is set. Accent bar
by paymentStatus, overridden to amber when flagged
as duplicate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 15:34:04 +02:00
|
|
|
import { BerthCard } from './berth-card';
|
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 { berthColumns, type BerthRow } from './berth-columns';
|
|
|
|
|
import { berthFilterDefinitions } from './berth-filters';
|
|
|
|
|
import { Anchor } from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
export function BerthList() {
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
const params = useParams<{ portSlug: string }>();
|
|
|
|
|
|
2026-04-28 02:52:17 +02:00
|
|
|
const { data, pagination, isLoading, sort, setSort, filters, setFilter, clearFilters, setPage } =
|
|
|
|
|
usePaginatedQuery<BerthRow>({
|
|
|
|
|
queryKey: ['berths'],
|
|
|
|
|
endpoint: '/api/v1/berths',
|
|
|
|
|
filterDefinitions: berthFilterDefinitions,
|
|
|
|
|
});
|
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
|
|
|
|
|
|
|
|
useRealtimeInvalidation({
|
|
|
|
|
'berth:updated': [['berths']],
|
|
|
|
|
'berth:statusChanged': [['berths']],
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
<PageHeader
|
|
|
|
|
title="Berths"
|
|
|
|
|
description="View and manage berth allocations"
|
2026-04-28 02:52:17 +02:00
|
|
|
variant="gradient"
|
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
|
|
|
// No "New" button — berths are import-only
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2 flex-wrap">
|
|
|
|
|
<FilterBar
|
|
|
|
|
filters={berthFilterDefinitions}
|
|
|
|
|
values={filters}
|
|
|
|
|
onChange={setFilter}
|
|
|
|
|
onClear={clearFilters}
|
|
|
|
|
/>
|
|
|
|
|
<div className="ml-auto">
|
|
|
|
|
<SavedViewsDropdown
|
|
|
|
|
entityType="berths"
|
|
|
|
|
currentFilters={filters}
|
|
|
|
|
currentSort={sort}
|
2026-03-26 12:06:18 +01:00
|
|
|
onApplyView={(savedFilters, _savedSort) => {
|
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
|
|
|
clearFilters();
|
|
|
|
|
Object.entries(savedFilters).forEach(([key, value]) => setFilter(key, value));
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<DataTable<BerthRow>
|
|
|
|
|
columns={berthColumns}
|
|
|
|
|
data={data}
|
|
|
|
|
isLoading={isLoading}
|
|
|
|
|
pagination={{
|
|
|
|
|
page: pagination.page,
|
|
|
|
|
pageSize: pagination.pageSize,
|
|
|
|
|
total: pagination.total,
|
|
|
|
|
totalPages: pagination.totalPages,
|
|
|
|
|
}}
|
|
|
|
|
onPaginationChange={(page) => setPage(page)}
|
|
|
|
|
sort={sort}
|
|
|
|
|
onSortChange={setSort}
|
|
|
|
|
getRowId={(row) => row.id}
|
|
|
|
|
onRowClick={(row) => router.push(`/${params.portSlug}/berths/${row.id}`)}
|
feat(mobile): mobile cards for yachts, companies, berths, invoices, expenses
Five new <EntityCard> files using the shared <ListCard> shell, wired
into each list page's <DataTable> via cardRender. Desktop view
(lg+) is unchanged.
- YachtCard: Ship icon, owner subtitle (User/Building2 icon by
ownerType), dimensions in meters preferred, hull #,
status pill. No accent bar (status is free-text).
- CompanyCard: Building2 icon, legalName subtitle, country (MapPin)
+ tax id (Hash) meta, member/yacht count line.
- BerthCard: Anchor icon, area subtitle (MapPin), dimensions
meta, status pill. Status-encoded accent bar
(emerald=available, amber=under_offer, slate=sold).
- InvoiceCard: FileText icon, client subtitle, due date (Calendar)
meta, prominent currency-formatted amount. Status
accent bar (emerald=paid, orange=overdue, ...).
- ExpenseCard: Receipt icon, category subtitle, expense date meta,
prominent amount, payment-status pill, "Possible
duplicate" pill when duplicateOf is set. Accent bar
by paymentStatus, overridden to amber when flagged
as duplicate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 15:34:04 +02:00
|
|
|
cardRender={(row) => <BerthCard berth={row.original} />}
|
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
|
|
|
emptyState={
|
|
|
|
|
<EmptyState
|
|
|
|
|
icon={Anchor}
|
|
|
|
|
title="No berths found"
|
|
|
|
|
description="Berths are imported from external sources. Adjust your filters to find what you're looking for."
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|