/** * 거래처 상세 보기 컴포넌트 * * 스크린샷 기준 4개 섹션: * 1. 기본 정보 * 2. 연락처 정보 * 3. 결제 정보 * 4. 악성채권 정보 (있는 경우 빨간 테두리) */ "use client"; import { Button } from "../ui/button"; import { Badge } from "../ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "../ui/card"; import { Building2, Phone, CreditCard, AlertTriangle, ArrowLeft, Pencil, Trash2, MapPin, Mail, } from "lucide-react"; import { Client } from "../../hooks/useClientList"; import { PageLayout } from "../organisms/PageLayout"; import { PageHeader } from "../organisms/PageHeader"; import { useMenuStore } from "@/store/menuStore"; interface ClientDetailProps { client: Client; onBack: () => void; onEdit: () => void; onDelete: () => void; } // 상세 항목 표시 컴포넌트 function DetailItem({ label, value, icon, valueClassName, }: { label: string; value: React.ReactNode; icon?: React.ReactNode; valueClassName?: string; }) { return (

{label}

{icon} {value || "-"}
); } export function ClientDetail({ client, onBack, onEdit, onDelete, }: ClientDetailProps) { const sidebarCollapsed = useMenuStore((state) => state.sidebarCollapsed); // 금액 포맷 const formatCurrency = (amount: string) => { if (!amount) return "-"; const num = Number(amount); return `₩${num.toLocaleString()}`; }; return ( {/* 헤더 */}
{/* 1. 기본 정보 */}
기본 정보
{client.clientType} } />
{client.status} } />
} />
{client.memo && ( )}
{/* 2. 연락처 정보 */}
연락처 정보
} /> } />
} />
{/* 3. 결제 정보 */}
결제 정보
{/* 4. 악성채권 정보 (있는 경우에만 표시) */} {client.badDebt && (
악성채권 정보
)}
{/* 하단 액션 버튼 (sticky) */}
); }