summaryrefslogtreecommitdiff
path: root/lib/bidding/selection/bidding-info-card.tsx
blob: 5904bf65b7be893a5339416d9b9641837ac05780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import * as React from 'react'
import { Bidding } from '@/db/schema'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
// import { formatDate } from '@/lib/utils'
import { biddingStatusLabels, contractTypeLabels } from '@/db/schema'

// 입찰유형 라벨 맵 추가
const biddingTypeLabels: Record<string, string> = {
  equipment: '기자재',
  construction: '공사',
  service: '용역',
  lease: '임차',
  transport: '운송',
  waste: '폐기물',
  sale: '매각',
  other: '기타(직접입력)',
}

interface BiddingInfoCardProps {
  bidding: Bidding
}

export function BiddingInfoCard({ bidding }: BiddingInfoCardProps) {
  return (
    <Card>
      <CardHeader>
        <CardTitle>입찰정보</CardTitle>
      </CardHeader>
      <CardContent>
        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
          {/* 입찰명 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              입찰명
            </label>
            <div className="text-sm font-medium">
              {bidding.title || '-'}
            </div>
          </div>

          {/* 입찰번호 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              입찰번호
            </label>
            <div className="text-sm font-medium">
              {bidding.biddingNumber || '-'}
            </div>
          </div>

          {/* 내정가 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              내정가
            </label>
            <div className="text-sm font-medium">
              {bidding.targetPrice
                ? `${Number(bidding.targetPrice).toLocaleString()} ${bidding.currency || 'KRW'}`
                : '-'
              }
            </div>
          </div>

          {/* 입찰유형 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              입찰유형
            </label>
            <div className="text-sm font-medium">
              {biddingTypeLabels[bidding.biddingType as keyof typeof biddingTypeLabels] || bidding.biddingType || '-'}
            </div>
          </div>

          {/* 진행상태 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              진행상태
            </label>
            <div className="text-sm font-medium">
              {biddingStatusLabels[bidding.status as keyof typeof biddingStatusLabels] || bidding.status}
            </div>
          </div>

          {/* 입찰담당자 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              입찰담당자
            </label>
            <div className="text-sm font-medium">
              {bidding.bidPicName || '-'}
            </div>
          </div>

          {/* 계약구분 */}
          <div className="space-y-2">
            <label className="text-sm font-medium text-muted-foreground">
              계약구분
            </label>
            <div className="text-sm font-medium">
              {contractTypeLabels[bidding.contractType as keyof typeof contractTypeLabels] || bidding.contractType}
            </div>
          </div>
        </div>
      </CardContent>
    </Card>
  )
}