2026-04-15 04:59:05 +03:00

31 lines
1.2 KiB
TypeScript

import { getServerApi } from '@garage/api/server'
import { EstimateGeneralInfo } from '@/modules/estimates/estimate-general-info'
import { EstimateServicesSection } from '@/modules/estimates/estimate-services-section'
import { EstimatePartsSection } from '@/modules/estimates/estimate-parts-section'
import { EstimateExpenseItemsSection } from '@/modules/estimates/estimate-expense-items-section'
import DashboardPage from '@/base/components/layout/dashboard/dashboard-page'
export default async function page(props: { params: Promise<{ id: string }> }) {
const { id } = await props.params
const api = await getServerApi()
const estimate = await api.estimates.getById(id)
const estimateData = (estimate as any)?.data
if (!estimateData) {
return <div className="text-muted-foreground p-4">Estimate not found.</div>
}
return (
<DashboardPage header={null}>
<div className="grid gap-6">
<EstimateGeneralInfo estimate={estimateData} />
<EstimateServicesSection estimateId={id} />
<EstimatePartsSection estimateId={id} />
<EstimateExpenseItemsSection estimateId={id} />
</div>
</DashboardPage>
)
}