diff --git a/src/components/JobCardHeader.tsx b/src/components/JobCardHeader.tsx index 1063e07..07b249b 100644 --- a/src/components/JobCardHeader.tsx +++ b/src/components/JobCardHeader.tsx @@ -1,4 +1,3 @@ - import { CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Copy, BarChart3 } from 'lucide-react'; @@ -43,68 +42,73 @@ const JobCardHeader: React.FC = ({ }; return ( -
-
-
- - {job.outputItem} - {copying === 'name' && } - + <> +
+
+
+ + {job.outputItem} + {copying === 'name' && } + +
+
+
+ Runs: {job.outputQuantity.toLocaleString()} + + Produced: + + + Sold: {itemsSold.toLocaleString()} + +
+
-
-
- Runs: {job.outputQuantity.toLocaleString()} - - Produced: - - - Sold: {itemsSold.toLocaleString()} - +
+
+ + + +
+
+ +
-
-
- - - - -
-
- - -
+ +
+
= ({ isOpen={totalProfitChartOpen} onClose={() => setTotalProfitChartOpen(false)} /> -
+ ); }; diff --git a/src/components/JobStatusNavigation.tsx b/src/components/JobStatusNavigation.tsx index 9028e3d..206a520 100644 --- a/src/components/JobStatusNavigation.tsx +++ b/src/components/JobStatusNavigation.tsx @@ -67,7 +67,7 @@ const JobStatusNavigation: React.FC = ({ job }) => { }; return ( -
+
{previousStatus && ( )} {nextStatus && ( @@ -91,11 +92,12 @@ const JobStatusNavigation: React.FC = ({ job }) => { e.stopPropagation(); handleStatusChange(nextStatus); }} - className="border-gray-600 hover:bg-gray-800 p-2" + className="border-gray-600 hover:bg-gray-800 px-3" data-no-navigate title={`Move to ${nextStatus}`} > - + {nextStatus} + )}
diff --git a/src/utils/jobStatusUtils.ts b/src/utils/jobStatusUtils.ts index f04a82d..7891c07 100644 --- a/src/utils/jobStatusUtils.ts +++ b/src/utils/jobStatusUtils.ts @@ -52,16 +52,20 @@ export const getStatusPriority = (status: IndJobStatusOptions): number => { } }; -export const JOB_STATUSES = ['Planned', 'Acquisition', 'Staging', 'Inbound', 'Running', 'Done', 'Delivered', 'Outbound', 'Selling', 'Closed', 'Tracked'] as const; +// Use the actual type values from the enum +export const JOB_STATUSES: IndJobStatusOptions[] = [ + 'Planned', 'Acquisition', 'Staging', 'Inbound', 'Running', 'Done', + 'Delivered', 'Outbound', 'Selling', 'Closed', 'Tracked' +]; -export const getNextStatus = (currentStatus: string): string | null => { - const currentIndex = JOB_STATUSES.indexOf(currentStatus as any); +export const getNextStatus = (currentStatus: string): IndJobStatusOptions | null => { + const currentIndex = JOB_STATUSES.indexOf(currentStatus as IndJobStatusOptions); if (currentIndex === -1 || currentIndex === JOB_STATUSES.length - 1) return null; return JOB_STATUSES[currentIndex + 1]; }; -export const getPreviousStatus = (currentStatus: string): string | null => { - const currentIndex = JOB_STATUSES.indexOf(currentStatus as any); +export const getPreviousStatus = (currentStatus: string): IndJobStatusOptions | null => { + const currentIndex = JOB_STATUSES.indexOf(currentStatus as IndJobStatusOptions); if (currentIndex <= 0) return null; return JOB_STATUSES[currentIndex - 1]; };