- 백엔드: quotation 목록 search 파라미터(name/number ILIKE) 추가; card 목록 is_wildcard 탭 필터 + total_nego/total_wild 탭 카운트 추가; status/type 코드 int 비교 보정 - 프론트: cards/quotation 검색·상태·유형 필터·페이지네이션을 useServerList 기반 서버사이드로 전환; 엔터 즉시검색 + 디바운스 500ms·최소 2글자; 죽은 client 필터 훅(useCardFilters/useQuotationFilters) 제거 - generated 파라미터/응답 타입 손보강(listCardsParams.is_wildcard, listQuotationsParams.search, resCardList.total_nego/total_wild) — orval 재생성 시 동일 - 견적 상세 Drawer→Sheet 분리, useOverlayParams→useOverlayRouter, CreateQuotationWizard→QuotationCreateModal Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
2.6 KiB
TypeScript
58 lines
2.6 KiB
TypeScript
import { Link } from 'react-router';
|
|
import { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from '@/components/ui/table';
|
|
import { StatusPill } from './StatusPill';
|
|
import { mapServerCardView } from '../../types';
|
|
|
|
type CardView = ReturnType<typeof mapServerCardView>;
|
|
|
|
export function QuotationCardsTab({ quotationCardViews }: { quotationCardViews: CardView[] }) {
|
|
return (
|
|
<div className="space-y-4">
|
|
<div className="border border-border rounded-lg bg-card overflow-hidden">
|
|
<Table className="w-full text-left text-xs border-collapse font-mono">
|
|
<TableHeader className="bg-muted text-muted-foreground text-[10px] border-b border-border">
|
|
<TableRow>
|
|
<TableHead className="p-3 font-semibold">세션 카드 ID</TableHead>
|
|
<TableHead className="p-3 font-semibold font-sans">카드 이름</TableHead>
|
|
<TableHead className="p-3 font-semibold font-sans">타입</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody className="divide-y divide-border">
|
|
{quotationCardViews.length > 0 ? (
|
|
quotationCardViews.map((qc) => (
|
|
<TableRow key={qc.session_card_id} className="hover:bg-muted/30 transition-colors text-[11px]">
|
|
<TableCell className="p-3 text-muted-foreground">{qc.session_card_id}</TableCell>
|
|
<TableCell className="p-3 text-foreground font-sans font-semibold">
|
|
{qc.card_id ? (
|
|
<Link
|
|
to={`/cards?edit=${qc.card_id}`}
|
|
className="hover:text-primary hover:underline"
|
|
title={`${qc.card_name} — 협상카드 상세로 이동`}
|
|
>
|
|
{qc.card_name}
|
|
</Link>
|
|
) : (
|
|
qc.card_name
|
|
)}
|
|
</TableCell>
|
|
<TableCell className="p-3">
|
|
<StatusPill tone={qc.type === '와일드 카드' ? 'amber' : 'zinc'} className="rounded">
|
|
{qc.type}
|
|
</StatusPill>
|
|
</TableCell>
|
|
</TableRow>
|
|
))
|
|
) : (
|
|
<TableRow>
|
|
<TableCell colSpan={3} className="p-12 text-center text-muted-foreground">
|
|
사용된 협상 카드가 없습니다. (리스트가 비어 있습니다)
|
|
</TableCell>
|
|
</TableRow>
|
|
)}
|
|
</TableBody>
|
|
</Table>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|