feat(berths): click-to-change status from the list (chip → reason modal)
Adds BerthStatusQuickEdit — wraps the status chip on the berths list (card + table) in a click target that opens a compact change-status dialog: status dropdown + required reason (quick-pick chips) + optional interest link when moving to under_offer/sold. Reuses the existing PATCH /api/v1/berths/[id]/status endpoint + validator + audit (same capability the detail page already had). Gated by berths.edit (non-editors see a plain chip); stops click propagation so it doesn't also navigate into the berth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
import { TagBadge } from '@/components/shared/tag-badge';
|
||||
import { ListCard, ListCardAvatar, ListCardMeta } from '@/components/shared/list-card';
|
||||
import { StatusPill, type StatusPillStatus } from '@/components/ui/status-pill';
|
||||
import { BerthStatusQuickEdit } from './berth-status-quick-edit';
|
||||
import { formatCurrency } from '@/lib/utils/currency';
|
||||
import type { BerthRow } from './berth-columns';
|
||||
import { mooringLetterDot } from './mooring-letter-tone';
|
||||
@@ -167,7 +168,9 @@ export function BerthCard({ berth }: BerthCardProps) {
|
||||
|
||||
{/* Status pill + tags */}
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-1.5">
|
||||
<StatusPill status={statusPill}>{statusLabel}</StatusPill>
|
||||
<BerthStatusQuickEdit berthId={berth.id} currentStatus={berth.status}>
|
||||
<StatusPill status={statusPill}>{statusLabel}</StatusPill>
|
||||
</BerthStatusQuickEdit>
|
||||
{tags.slice(0, 2).map((tag) => (
|
||||
<TagBadge key={tag.id} name={tag.name} color={tag.color} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user