summaryrefslogtreecommitdiff
path: root/lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx')
-rw-r--r--lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx57
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx b/lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx
new file mode 100644
index 00000000..692d12ea
--- /dev/null
+++ b/lib/bidding/pre-quote/table/bidding-pre-quote-content.tsx
@@ -0,0 +1,57 @@
+'use client'
+
+import * as React from 'react'
+import { Bidding } from '@/db/schema'
+import { QuotationDetails, QuotationVendor } from '@/lib/bidding/detail/service'
+import { getBiddingCompanies } from '../service'
+
+import { BiddingPreQuoteVendorTableContent } from './bidding-pre-quote-vendor-table'
+
+interface BiddingPreQuoteContentProps {
+ bidding: Bidding
+ quotationDetails: QuotationDetails | null
+ quotationVendors: QuotationVendor[]
+ biddingCompanies: any[]
+ prItems: any[]
+}
+
+export function BiddingPreQuoteContent({
+ bidding,
+ quotationDetails,
+ quotationVendors,
+ biddingCompanies: initialBiddingCompanies,
+ prItems
+}: BiddingPreQuoteContentProps) {
+ const [biddingCompanies, setBiddingCompanies] = React.useState(initialBiddingCompanies)
+ const [refreshTrigger, setRefreshTrigger] = React.useState(0)
+
+ const handleRefresh = React.useCallback(async () => {
+ try {
+ const result = await getBiddingCompanies(bidding.id)
+ if (result.success && result.data) {
+ setBiddingCompanies(result.data)
+ }
+ setRefreshTrigger(prev => prev + 1)
+ } catch (error) {
+ console.error('Failed to refresh bidding companies:', error)
+ }
+ }, [bidding.id])
+
+ return (
+ <div className="space-y-6">
+ <BiddingPreQuoteVendorTableContent
+ biddingId={bidding.id}
+ bidding={bidding}
+ vendors={quotationVendors}
+ biddingCompanies={biddingCompanies}
+ onRefresh={handleRefresh}
+ onOpenItemsDialog={() => {}}
+ onOpenTargetPriceDialog={() => {}}
+ onOpenSelectionReasonDialog={() => {}}
+ onEdit={undefined}
+ onDelete={undefined}
+ onSelectWinner={undefined}
+ />
+ </div>
+ )
+}