import { DashboardDetailsPage } from '@/base/components/layout/dashboard' import { getServerApi } from '@garage/api/server' import { JobCardActions } from '@/modules/job-cards/job-card-actions' import { JobCardProvider } from '@/modules/job-cards/job-card-context' import { JobCardStatusStepper } from '@/modules/job-cards/job-card-status-stepper' import { ClipboardListIcon, Ellipsis, Pencil, Trash2 } from 'lucide-react' import React from 'react' import JobCardDropdown from '@/modules/job-cards/job-card-dropdown' export default async function JobCardDetailLayout(props: { params: Promise<{ id: string }>, children: React.ReactNode }) { const { id } = await props.params const api = await getServerApi() const jobCard = await api.jobCards.show(id).then(res => res.data) const title = jobCard?.title || 'Job Card Details' const status = jobCard?.status || 'draft' const docs = jobCard?.documents return ( w.charAt(0).toUpperCase() + w.slice(1)).join(" ")}` : undefined} icon={} backHref="/sales/job-cards" actions={ } subHeader={} tabs={[ { href: `/sales/job-cards/${id}`, label: 'Details' }, { href: `/sales/job-cards/${id}/customer-remarks`, label: 'Customer Remarks' }, { href: `/sales/job-cards/${id}/shop-recommendations`, label: 'Shop Recommendations' }, { href: `/sales/job-cards/${id}/attachments`, label: `Attachments (${docs?.length || 0})` }, { href: `/sales/job-cards/${id}/purchase-orders`, label: `Purchase Orders (${jobCard?.purchase_orders_count || 0})` }, { href: `/sales/job-cards/${id}/bills`, label: `Bills (${jobCard?.bills_count || 0})` }, { href: `/sales/job-cards/${id}/appointments`, label: `Appointments (${jobCard?.appointments_count || 0})` }, { href: `/sales/job-cards/${id}/expenses`, label: `Expenses (${jobCard?.expenses_count || 0})` }, { href: `/sales/job-cards/${id}/tasks`, label: `Tasks (${jobCard?.tasks_count || 0})` }, ]} > {props.children} ) }