From a2bc455f654e011c53968b0d3a14389d7259847e Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 3 Sep 2025 10:35:57 +0000 Subject: (최겸) 구매 입찰 개발(벤더 응찰 개발 및 기본계약 요청 개발 필) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/bidding/bidding-info-header.tsx | 149 +++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 components/bidding/bidding-info-header.tsx (limited to 'components/bidding/bidding-info-header.tsx') diff --git a/components/bidding/bidding-info-header.tsx b/components/bidding/bidding-info-header.tsx new file mode 100644 index 00000000..c140920b --- /dev/null +++ b/components/bidding/bidding-info-header.tsx @@ -0,0 +1,149 @@ +import { Bidding } from '@/db/schema/bidding' +import { Building2, Package, User, DollarSign, Calendar } from 'lucide-react' +import { contractTypeLabels, biddingTypeLabels } from '@/db/schema/bidding' + +interface BiddingInfoHeaderProps { + bidding: Bidding +} + +function formatDate(date: Date | string | null | undefined, locale: 'KR' | 'EN' = 'KR'): string { + if (!date) return '' + + const dateObj = typeof date === 'string' ? new Date(date) : date + + if (locale === 'KR') { + return dateObj.toLocaleDateString('ko-KR', { + year: 'numeric', + month: '2-digit', + day: '2-digit' + }).replace(/\./g, '-').replace(/-$/, '') + } + + return dateObj.toLocaleDateString('en-US', { + year: 'numeric', + month: '2-digit', + day: '2-digit' + }) +} + +export function BiddingInfoHeader({ bidding }: BiddingInfoHeaderProps) { + return ( +
+ {/* 주요 정보 섹션 */} +
+ {/* 프로젝트 정보 */} + {bidding.projectName && ( +
+
+ + 프로젝트 +
+
{bidding.projectName}
+
+ )} + + {/* 품목 정보 */} + {bidding.itemName && ( +
+
+ + 품목 +
+
{bidding.itemName}
+
+ )} + + {/* 담당자 정보 */} + {bidding.managerName && ( +
+
+ + 담당자 +
+
{bidding.managerName}
+
+ )} + + {/* 예산 정보 */} + {bidding.budget && ( +
+
+ + 예산 +
+
+ {new Intl.NumberFormat('ko-KR', { + style: 'currency', + currency: bidding.currency || 'KRW', + }).format(Number(bidding.budget))} +
+
+ )} +
+ + {/* 구분선 */} +
+ {/* 계약 정보 */} +
+
+ 계약 + {contractTypeLabels[bidding.contractType]} +
+ +
+ 유형 + {biddingTypeLabels[bidding.biddingType]} +
+ +
+ 낙찰 + {bidding.awardCount === 'single' ? '단수' : '복수'} +
+ +
+ 통화 + {bidding.currency} +
+
+
+ + {/* 일정 정보 */} + {(bidding.submissionStartDate || bidding.evaluationDate || bidding.preQuoteDate || bidding.biddingRegistrationDate) && ( +
+
+ + 일정 정보 +
+
+ {bidding.submissionStartDate && bidding.submissionEndDate && ( +
+ 제출기간 +
+ {formatDate(bidding.submissionStartDate, 'KR')} ~ {formatDate(bidding.submissionEndDate, 'KR')} +
+
+ )} + {bidding.biddingRegistrationDate && ( +
+ 입찰등록일 +
{formatDate(bidding.biddingRegistrationDate, 'KR')}
+
+ )} + {bidding.preQuoteDate && ( +
+ 사전견적일 +
{formatDate(bidding.preQuoteDate, 'KR')}
+
+ )} + {bidding.evaluationDate && ( +
+ 평가일 +
{formatDate(bidding.evaluationDate, 'KR')}
+
+ )} +
+
+ )} +
+ ) +} -- cgit v1.2.3