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 { useState } from 'react';
|
|
|
|
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
2026-05-02 00:01:33 +02:00
|
|
|
import { Pencil, Archive, RotateCcw, Trophy, XCircle, RefreshCcw } 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 Link from 'next/link';
|
|
|
|
|
|
|
|
|
|
import { Badge } from '@/components/ui/badge';
|
|
|
|
|
import { TagBadge } from '@/components/shared/tag-badge';
|
|
|
|
|
import { ArchiveConfirmDialog } from '@/components/shared/archive-confirm-dialog';
|
2026-04-28 12:09:47 +02:00
|
|
|
import { DetailHeaderStrip } from '@/components/shared/detail-header-strip';
|
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 { PermissionGate } from '@/components/shared/permission-gate';
|
|
|
|
|
import { InterestForm } from '@/components/interests/interest-form';
|
2026-05-02 00:01:33 +02:00
|
|
|
import { InlineStagePicker } from '@/components/interests/inline-stage-picker';
|
|
|
|
|
import { InterestOutcomeDialog } from '@/components/interests/interest-outcome-dialog';
|
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 { apiFetch } from '@/lib/api/client';
|
2026-05-02 00:01:33 +02:00
|
|
|
import { cn } from '@/lib/utils';
|
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-02 00:01:33 +02:00
|
|
|
const OUTCOME_BADGE: Record<string, { label: string; className: string }> = {
|
|
|
|
|
won: { label: 'Won', className: 'bg-emerald-100 text-emerald-700' },
|
|
|
|
|
lost_other_marina: { label: 'Lost — other marina', className: 'bg-rose-100 text-rose-700' },
|
|
|
|
|
lost_unqualified: { label: 'Lost — unqualified', className: 'bg-rose-100 text-rose-700' },
|
|
|
|
|
lost_no_response: { label: 'Lost — no response', className: 'bg-rose-100 text-rose-700' },
|
|
|
|
|
cancelled: { label: 'Cancelled', className: 'bg-slate-200 text-slate-700' },
|
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 CATEGORY_LABELS: Record<string, string> = {
|
2026-05-02 00:01:33 +02:00
|
|
|
general_interest: 'General',
|
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
|
|
|
specific_qualified: 'Specific Qualified',
|
|
|
|
|
hot_lead: 'Hot Lead',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
interface InterestDetailHeaderProps {
|
|
|
|
|
portSlug: string;
|
|
|
|
|
interest: {
|
|
|
|
|
id: string;
|
|
|
|
|
clientId: string;
|
|
|
|
|
clientName: string | null;
|
|
|
|
|
berthId: string | null;
|
|
|
|
|
berthMooringNumber: string | null;
|
|
|
|
|
pipelineStage: string;
|
|
|
|
|
leadCategory: string | null;
|
|
|
|
|
source: string | null;
|
|
|
|
|
notes: string | null;
|
|
|
|
|
reminderEnabled: boolean;
|
|
|
|
|
reminderDays: number | null;
|
|
|
|
|
archivedAt: string | null;
|
2026-05-02 00:01:33 +02:00
|
|
|
outcome?: string | null;
|
|
|
|
|
outcomeReason?: string | null;
|
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
|
|
|
tags?: Array<{ id: string; name: string; color: string }>;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function InterestDetailHeader({ portSlug, interest }: InterestDetailHeaderProps) {
|
|
|
|
|
const queryClient = useQueryClient();
|
|
|
|
|
const [editOpen, setEditOpen] = useState(false);
|
|
|
|
|
const [archiveOpen, setArchiveOpen] = useState(false);
|
2026-05-02 00:01:33 +02:00
|
|
|
const [outcomeDialog, setOutcomeDialog] = useState<null | 'won' | 'lost'>(null);
|
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 isArchived = !!interest.archivedAt;
|
2026-05-02 00:01:33 +02:00
|
|
|
const outcomeBadge = interest.outcome ? OUTCOME_BADGE[interest.outcome] : null;
|
|
|
|
|
const isClosed = !!interest.outcome;
|
|
|
|
|
|
|
|
|
|
const reopenMutation = useMutation({
|
|
|
|
|
mutationFn: () =>
|
|
|
|
|
apiFetch(`/api/v1/interests/${interest.id}/outcome`, { method: 'DELETE', body: {} }),
|
|
|
|
|
onSuccess: () => {
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests', interest.id] });
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests'] });
|
|
|
|
|
},
|
|
|
|
|
});
|
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 archiveMutation = useMutation({
|
2026-04-28 12:09:47 +02:00
|
|
|
mutationFn: () => apiFetch(`/api/v1/interests/${interest.id}`, { method: 'DELETE' }),
|
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
|
|
|
onSuccess: () => {
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests', interest.id] });
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests'] });
|
|
|
|
|
setArchiveOpen(false);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const restoreMutation = useMutation({
|
2026-04-28 12:09:47 +02:00
|
|
|
mutationFn: () => apiFetch(`/api/v1/interests/${interest.id}/restore`, { method: 'POST' }),
|
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
|
|
|
onSuccess: () => {
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests', interest.id] });
|
|
|
|
|
queryClient.invalidateQueries({ queryKey: ['interests'] });
|
|
|
|
|
setArchiveOpen(false);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
2026-05-02 00:01:33 +02:00
|
|
|
const meta: Array<{ key: string; node: React.ReactNode }> = [];
|
|
|
|
|
if (interest.berthMooringNumber) {
|
|
|
|
|
meta.push({
|
|
|
|
|
key: 'berth',
|
|
|
|
|
node: (
|
|
|
|
|
<Link
|
|
|
|
|
href={`/${portSlug}/berths/${interest.berthId}`}
|
|
|
|
|
className="text-foreground hover:underline"
|
|
|
|
|
>
|
|
|
|
|
Berth {interest.berthMooringNumber}
|
|
|
|
|
</Link>
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (interest.leadCategory) {
|
|
|
|
|
meta.push({
|
|
|
|
|
key: 'cat',
|
|
|
|
|
node: <span>{CATEGORY_LABELS[interest.leadCategory] ?? interest.leadCategory}</span>,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (interest.source) {
|
|
|
|
|
meta.push({
|
|
|
|
|
key: 'src',
|
|
|
|
|
node: <span className="capitalize">{interest.source}</span>,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
return (
|
|
|
|
|
<>
|
2026-04-28 12:09:47 +02:00
|
|
|
<DetailHeaderStrip>
|
2026-05-02 00:01:33 +02:00
|
|
|
<div className="flex items-start gap-2">
|
|
|
|
|
<div className="min-w-0 flex-1 space-y-1.5">
|
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 className="flex items-center gap-2 flex-wrap">
|
2026-05-02 00:01:33 +02:00
|
|
|
<h1 className="truncate text-lg font-bold text-foreground sm:text-xl">
|
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
|
|
|
{interest.clientName ?? 'Unknown Client'}
|
|
|
|
|
</h1>
|
|
|
|
|
{isArchived && (
|
2026-04-28 12:09:47 +02:00
|
|
|
<Badge variant="secondary" className="text-xs">
|
|
|
|
|
Archived
|
|
|
|
|
</Badge>
|
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-02 00:01:33 +02:00
|
|
|
{outcomeBadge ? (
|
|
|
|
|
<span
|
|
|
|
|
className={cn(
|
|
|
|
|
'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',
|
|
|
|
|
outcomeBadge.className,
|
|
|
|
|
)}
|
|
|
|
|
title={interest.outcomeReason ?? undefined}
|
|
|
|
|
>
|
|
|
|
|
{outcomeBadge.label}
|
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
|
|
|
</span>
|
2026-05-02 00:01:33 +02:00
|
|
|
) : (
|
|
|
|
|
<PermissionGate
|
|
|
|
|
resource="interests"
|
|
|
|
|
action="change_stage"
|
|
|
|
|
fallback={
|
|
|
|
|
<span className="inline-flex items-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-700">
|
|
|
|
|
{interest.pipelineStage}
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<InlineStagePicker
|
|
|
|
|
interestId={interest.id}
|
|
|
|
|
currentStage={interest.pipelineStage}
|
|
|
|
|
className="-ml-2.5"
|
|
|
|
|
/>
|
|
|
|
|
</PermissionGate>
|
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>
|
|
|
|
|
|
2026-05-02 00:01:33 +02:00
|
|
|
{meta.length > 0 ? (
|
|
|
|
|
<p className="text-xs text-muted-foreground sm:text-sm">
|
|
|
|
|
{meta.map((m, i) => (
|
|
|
|
|
<span key={m.key}>
|
|
|
|
|
{i > 0 ? (
|
|
|
|
|
<span aria-hidden className="mx-1.5">
|
|
|
|
|
·
|
|
|
|
|
</span>
|
|
|
|
|
) : null}
|
|
|
|
|
{m.node}
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
</p>
|
|
|
|
|
) : null}
|
|
|
|
|
|
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
|
|
|
{interest.tags && interest.tags.length > 0 && (
|
2026-05-02 00:01:33 +02:00
|
|
|
<div className="flex flex-wrap gap-1 pt-0.5">
|
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
|
|
|
{interest.tags.map((tag) => (
|
|
|
|
|
<TagBadge key={tag.id} name={tag.name} color={tag.color} />
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-05-02 00:01:33 +02:00
|
|
|
{/* Top-right icon-only actions — no stacking, no labels eating room. */}
|
|
|
|
|
<div className="flex shrink-0 items-center gap-0.5">
|
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
|
|
|
<PermissionGate resource="interests" action="change_stage">
|
2026-05-02 00:01:33 +02:00
|
|
|
{isClosed ? (
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => reopenMutation.mutate()}
|
|
|
|
|
disabled={reopenMutation.isPending}
|
|
|
|
|
aria-label="Reopen interest"
|
|
|
|
|
title="Reopen interest"
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-md p-1.5 text-muted-foreground/70 transition-colors',
|
|
|
|
|
'hover:bg-foreground/5 hover:text-foreground',
|
|
|
|
|
'disabled:opacity-50',
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<RefreshCcw className="size-4" />
|
|
|
|
|
</button>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => setOutcomeDialog('won')}
|
|
|
|
|
aria-label="Mark as won"
|
|
|
|
|
title="Mark as won"
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-md p-1.5 text-muted-foreground/70 transition-colors',
|
|
|
|
|
'hover:bg-emerald-50 hover:text-emerald-700',
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<Trophy className="size-4" />
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => setOutcomeDialog('lost')}
|
|
|
|
|
aria-label="Close as lost"
|
|
|
|
|
title="Close as lost"
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-md p-1.5 text-muted-foreground/70 transition-colors',
|
|
|
|
|
'hover:bg-rose-50 hover:text-rose-700',
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<XCircle className="size-4" />
|
|
|
|
|
</button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</PermissionGate>
|
|
|
|
|
<PermissionGate resource="interests" action="edit">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => setEditOpen(true)}
|
|
|
|
|
aria-label="Edit interest"
|
|
|
|
|
title="Edit interest"
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-md p-1.5 text-muted-foreground/70 transition-colors',
|
|
|
|
|
'hover:bg-foreground/5 hover:text-foreground',
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<Pencil className="size-4" />
|
|
|
|
|
</button>
|
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
|
|
|
</PermissionGate>
|
|
|
|
|
<PermissionGate resource="interests" action="delete">
|
2026-05-02 00:01:33 +02:00
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => setArchiveOpen(true)}
|
|
|
|
|
aria-label={isArchived ? 'Restore interest' : 'Archive interest'}
|
|
|
|
|
title={isArchived ? 'Restore interest' : 'Archive interest'}
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-md p-1.5 text-muted-foreground/70 transition-colors',
|
|
|
|
|
'hover:bg-foreground/5',
|
|
|
|
|
isArchived ? 'hover:text-foreground' : 'hover:text-destructive',
|
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-02 00:01:33 +02:00
|
|
|
>
|
|
|
|
|
{isArchived ? <RotateCcw className="size-4" /> : <Archive className="size-4" />}
|
|
|
|
|
</button>
|
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
|
|
|
</PermissionGate>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-28 12:09:47 +02:00
|
|
|
</DetailHeaderStrip>
|
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-02 00:01:33 +02:00
|
|
|
{outcomeDialog && (
|
|
|
|
|
<InterestOutcomeDialog
|
|
|
|
|
interestId={interest.id}
|
|
|
|
|
mode={outcomeDialog}
|
|
|
|
|
open={outcomeDialog !== null}
|
|
|
|
|
onOpenChange={(open) => !open && setOutcomeDialog(null)}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
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
|
|
|
<InterestForm
|
|
|
|
|
open={editOpen}
|
|
|
|
|
onOpenChange={setEditOpen}
|
2026-03-26 12:06:18 +01:00
|
|
|
interest={interest as unknown as Parameters<typeof InterestForm>[0]['interest']}
|
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
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<ArchiveConfirmDialog
|
|
|
|
|
open={archiveOpen}
|
|
|
|
|
onOpenChange={setArchiveOpen}
|
|
|
|
|
entityName={interest.clientName ?? 'Interest'}
|
|
|
|
|
entityType="Interest"
|
|
|
|
|
isArchived={isArchived}
|
|
|
|
|
onConfirm={() => {
|
|
|
|
|
if (isArchived) {
|
|
|
|
|
restoreMutation.mutate();
|
|
|
|
|
} else {
|
|
|
|
|
archiveMutation.mutate();
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
isLoading={archiveMutation.isPending || restoreMutation.isPending}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|