@@ -6,6 +6,7 @@ import { CreateInvoiceFromEstimateButton } from '@/modules/estimates/create-invo
|
||||
import { CreateJobCardFromEstimateButton } from '@/modules/estimates/create-job-card-from-estimate-button'
|
||||
import { FileTextIcon } from 'lucide-react'
|
||||
import React from 'react'
|
||||
import { formatDate } from '@/shared/utils/formatters'
|
||||
|
||||
export default async function layout(props: {
|
||||
params: Promise<{ id: string }>
|
||||
@@ -21,14 +22,18 @@ export default async function layout(props: {
|
||||
? `${estimateData.estimate_number}${estimateData.title ? ` — ${estimateData.title}` : ''}`
|
||||
: title
|
||||
|
||||
if (!estimateData) {
|
||||
return <div className="text-muted-foreground p-4">Estimate not found.</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<EstimateProvider estimate={{ id, label: estimateLabel, data: estimateData }}>
|
||||
<EstimateProvider estimate={estimateData}>
|
||||
<DashboardDetailsPage
|
||||
className="p-0 lg:p-0"
|
||||
icon={<FileTextIcon className="size-5" />}
|
||||
title={title}
|
||||
description={
|
||||
estimateData?.date ? `Date: ${estimateData.date}` : undefined
|
||||
estimateData?.date ? `Date: ${formatDate(estimateData.date)}` : undefined
|
||||
}
|
||||
backHref="/sales/estimates"
|
||||
actions={
|
||||
|
||||
@@ -3,6 +3,7 @@ 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 { EstimateTotalsSummary } from '@/modules/estimates/estimate-totals-summary'
|
||||
import DashboardPage from '@/base/components/layout/dashboard/dashboard-page'
|
||||
|
||||
export default async function page(props: { params: Promise<{ id: string }> }) {
|
||||
@@ -23,6 +24,7 @@ export default async function page(props: { params: Promise<{ id: string }> }) {
|
||||
<EstimateServicesSection estimateId={id} />
|
||||
<EstimatePartsSection estimateId={id} />
|
||||
<EstimateExpenseItemsSection estimateId={id} />
|
||||
<EstimateTotalsSummary />
|
||||
</div>
|
||||
</DashboardPage>
|
||||
)
|
||||
|
||||
@@ -9,6 +9,7 @@ import type { EstimatesClient } from '@garage/api'
|
||||
import { Car, FileTextIcon } from 'lucide-react'
|
||||
import { Button } from '@/shared/components/ui/button'
|
||||
import Link from 'next/link'
|
||||
import { formatDate } from '@/shared/utils/formatters'
|
||||
|
||||
export default function EstimatesPage() {
|
||||
return (
|
||||
@@ -67,6 +68,10 @@ export default function EstimatesPage() {
|
||||
{
|
||||
accessorKey: "date",
|
||||
header: ({ column }) => <ColumnHeader column={column} title="Date" />,
|
||||
cell: ({ row }) => {
|
||||
const item = row.original
|
||||
return formatDate(item.date)
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorKey: "has_insurance",
|
||||
|
||||
Reference in New Issue
Block a user