diff options
Diffstat (limited to 'lib/bidding/selection/vendor-selection-table.tsx')
| -rw-r--r-- | lib/bidding/selection/vendor-selection-table.tsx | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/bidding/selection/vendor-selection-table.tsx b/lib/bidding/selection/vendor-selection-table.tsx new file mode 100644 index 00000000..8570b5b6 --- /dev/null +++ b/lib/bidding/selection/vendor-selection-table.tsx @@ -0,0 +1,66 @@ +'use client' + +import * as React from 'react' +import { Bidding } from '@/db/schema' +import { BiddingDetailVendorTableContent } from '../detail/table/bidding-detail-vendor-table' +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { getBiddingDetailData } from '../detail/service' + +interface VendorSelectionTableProps { + biddingId: number + bidding: Bidding + onRefresh: () => void +} + +export function VendorSelectionTable({ biddingId, bidding, onRefresh }: VendorSelectionTableProps) { + const [vendors, setVendors] = React.useState<any[]>([]) + const [loading, setLoading] = React.useState(true) + + React.useEffect(() => { + const loadData = async () => { + try { + setLoading(true) + const data = await getBiddingDetailData(biddingId) + setVendors(data.quotationVendors) + } catch (error) { + console.error('Failed to load vendors:', error) + } finally { + setLoading(false) + } + } + + loadData() + }, [biddingId]) + + if (loading) { + return ( + <Card> + <CardHeader> + <CardTitle>업체선정</CardTitle> + </CardHeader> + <CardContent> + <div className="flex items-center justify-center py-8"> + <div className="text-sm text-muted-foreground">로딩 중...</div> + </div> + </CardContent> + </Card> + ) + } + + return ( + <Card> + <CardHeader> + <CardTitle>업체선정</CardTitle> + </CardHeader> + <CardContent> + <BiddingDetailVendorTableContent + biddingId={biddingId} + bidding={bidding} + vendors={vendors} + onRefresh={onRefresh} + onOpenSelectionReasonDialog={() => {}} + /> + </CardContent> + </Card> + ) +} |
