diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/bid/[id]/layout.tsx | 11 | ||||
| -rw-r--r-- | app/[lng]/evcp/(evcp)/bid/page.tsx | 8 | ||||
| -rw-r--r-- | app/[lng]/partners/(partners)/bid/page.tsx | 43 |
3 files changed, 27 insertions, 35 deletions
diff --git a/app/[lng]/evcp/(evcp)/bid/[id]/layout.tsx b/app/[lng]/evcp/(evcp)/bid/[id]/layout.tsx index 5c4e9b99..80e7f8d2 100644 --- a/app/[lng]/evcp/(evcp)/bid/[id]/layout.tsx +++ b/app/[lng]/evcp/(evcp)/bid/[id]/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from "next" import { Separator } from "@/components/ui/separator" import { SidebarNav } from "@/components/layout/sidebar-nav" -import { getBiddingById, getBiddingConditions, getActivePaymentTerms, getActiveIncoterms } from "@/lib/bidding/service" +import { getBiddingById, getBiddingConditions } from "@/lib/bidding/service" import { Bidding } from "@/db/schema/bidding" import { Button } from "@/components/ui/button" import { ArrowLeft } from "lucide-react" @@ -31,13 +31,6 @@ export default async function SettingsLayout({ const bidding: Bidding | null = await getBiddingById(idAsNumber) const biddingConditions = await getBiddingConditions(idAsNumber) - // 3) 옵션 데이터 가져오기 - const paymentTermsResult = await getActivePaymentTerms() - const incotermsResult = await getActiveIncoterms() - - const paymentTermsOptions = paymentTermsResult.success && 'data' in paymentTermsResult ? paymentTermsResult.data || [] : [] - const incotermsOptions = incotermsResult.success && 'data' in incotermsResult ? incotermsResult.data || [] : [] - // 3) 사이드바 메뉴 const sidebarNavItems = [ { @@ -81,8 +74,6 @@ export default async function SettingsLayout({ <BiddingConditionsEdit biddingId={bidding.id} initialConditions={biddingConditions} - paymentTermsOptions={paymentTermsOptions} - incotermsOptions={incotermsOptions} /> )} diff --git a/app/[lng]/evcp/(evcp)/bid/page.tsx b/app/[lng]/evcp/(evcp)/bid/page.tsx index c477e4f8..3a45e61f 100644 --- a/app/[lng]/evcp/(evcp)/bid/page.tsx +++ b/app/[lng]/evcp/(evcp)/bid/page.tsx @@ -7,8 +7,6 @@ import { getBiddingTypeCounts, getBiddingManagerCounts, getBiddingMonthlyStats, - getActivePaymentTerms, - getActiveIncoterms } from "@/lib/bidding/service" import { searchParamsCache } from "@/lib/bidding/validation" import { BiddingsPageHeader } from "@/lib/bidding/list/biddings-page-header" @@ -44,8 +42,6 @@ export default async function BiddingsPage(props: IndexPageProps) { getBiddingTypeCounts(), getBiddingManagerCounts(), getBiddingMonthlyStats(), - getActivePaymentTerms(), - getActiveIncoterms(), ]) return ( @@ -94,11 +90,9 @@ async function BiddingsStatsCardsWrapper({ Awaited<ReturnType<typeof getBiddingTypeCounts>>, Awaited<ReturnType<typeof getBiddingManagerCounts>>, Awaited<ReturnType<typeof getBiddingMonthlyStats>>, - Awaited<ReturnType<typeof getActivePaymentTerms>>, - Awaited<ReturnType<typeof getActiveIncoterms>> ]> }) { - const [biddingsResult, statusCounts, typeCounts, managerCounts, monthlyStats, paymentTermsResult, incotermsResult] = await promises + const [biddingsResult, statusCounts, typeCounts, managerCounts, monthlyStats] = await promises return ( <BiddingsStatsCards diff --git a/app/[lng]/partners/(partners)/bid/page.tsx b/app/[lng]/partners/(partners)/bid/page.tsx index bcb2ad25..a09dec72 100644 --- a/app/[lng]/partners/(partners)/bid/page.tsx +++ b/app/[lng]/partners/(partners)/bid/page.tsx @@ -1,8 +1,10 @@ import { PartnersBiddingList } from '@/lib/bidding/vendor/partners-bidding-list' -import { Suspense } from 'react' -import { Skeleton } from '@/components/ui/skeleton' +import * as React from "react" import { getServerSession } from 'next-auth' import { authOptions } from "@/app/api/auth/[...nextauth]/route" +import { getBiddingListForPartners } from '@/lib/bidding/detail/service' +import { Shell } from '@/components/shell' +import { DataTableSkeleton } from '@/components/data-table/data-table-skeleton' export default async function PartnersBidPage() { // 세션에서 companyId 가져오기 @@ -19,7 +21,13 @@ export default async function PartnersBidPage() { ) } + // 서버 사이드에서 입찰 목록 데이터 가져오기 + const promises = Promise.all([ + getBiddingListForPartners(companyId), + ]) + return ( + <Shell className="gap-2"> <div className="container mx-auto py-6 space-y-6"> <div className="flex items-center justify-between"> <div> @@ -30,22 +38,21 @@ export default async function PartnersBidPage() { </div> </div> - <Suspense fallback={<BiddingListSkeleton />}> - <PartnersBiddingList companyId={companyId} /> - </Suspense> - </div> - ) -} - -function BiddingListSkeleton() { - return ( - <div className="space-y-4"> - <Skeleton className="h-12 w-full" /> - <div className="space-y-2"> - {Array.from({ length: 5 }).map((_, i) => ( - <Skeleton key={i} className="h-16 w-full" /> - ))} + <React.Suspense + fallback={ + <DataTableSkeleton + columnCount={6} + searchableColumnCount={1} + filterableColumnCount={2} + cellWidths={["10rem", "40rem", "12rem", "12rem", "8rem", "8rem"]} + shrinkZero + /> + } + > + <PartnersBiddingList companyId={companyId} promises={promises} /> + </React.Suspense> </div> - </div> + </Shell> ) } + |
