diff --git a/src/components/JobForm.tsx b/src/components/JobForm.tsx index 127622f..ae44e11 100644 --- a/src/components/JobForm.tsx +++ b/src/components/JobForm.tsx @@ -1,3 +1,4 @@ + import React, { useState } from 'react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; @@ -21,7 +22,8 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { outputQuantity: job?.outputQuantity || 0, status: job?.status || IndJobStatusOptions.Planned, projectedCost: job?.projectedCost || 0, - projectedRevenue: job?.projectedRevenue || 0 + projectedRevenue: job?.projectedRevenue || 0, + runtime: job?.runtime || 0 }); const [jobDump, setJobDump] = useState(''); @@ -35,7 +37,7 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { const lines = dumpText.trim().split('\n').filter(line => line.trim()); - if (lines.length >= 3) { + if (lines.length >= 4) { // Parse first line: "Item Name Quantity" const firstLine = lines[0].trim(); const lastSpaceIndex = firstLine.lastIndexOf(' '); @@ -44,22 +46,26 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { const itemName = firstLine.substring(0, lastSpaceIndex).trim(); const quantity = parseInt(firstLine.substring(lastSpaceIndex + 1).trim()) || 0; - // Parse cost (second line) - const cost = parseISKAmount(lines[1].replace(/,/g, '')); + // Parse runtime (second line) + const runtime = parseInt(lines[1].replace(/,/g, '')) || 0; - // Parse revenue (third line) - const revenue = parseISKAmount(lines[2].replace(/,/g, '')); + // Parse cost (third line) + const cost = parseISKAmount(lines[2].replace(/,/g, '')); + + // Parse revenue (fourth line) + const revenue = parseISKAmount(lines[3].replace(/,/g, '')); setFormData(prev => ({ ...prev, outputItem: itemName, outputQuantity: quantity, + runtime: runtime, projectedCost: cost, projectedRevenue: revenue })); - // Parse BOM - everything after the first 3 lines is BOM - const bomLines = lines.slice(3); // Start from line 4 (index 3) + // Parse BOM - everything after the first 4 lines is BOM + const bomLines = lines.slice(4); // Start from line 5 (index 4) const billOfMaterials: { name: string; quantity: number }[] = []; for (const line of bomLines) { @@ -95,7 +101,8 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { outputQuantity: formData.outputQuantity, status: formData.status, projectedCost: formData.projectedCost, - projectedRevenue: formData.projectedRevenue + projectedRevenue: formData.projectedRevenue, + runtime: formData.runtime }, parsedBillOfMaterials.length > 0 ? parsedBillOfMaterials : undefined); }; @@ -159,7 +166,20 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { -
+
+
+ + setFormData({ + ...formData, + runtime: parseInt(e.target.value) || 0 + })} + className="bg-gray-800 border-gray-600 text-white" + /> +
= ({ job, onSubmit, onCancel }) => { id="jobDump" value={jobDump} onChange={handleJobDumpChange} - placeholder="Paste job dump here: Standup Light Guided Bomb 100 285,224,182 771,342,930 Megacyte 37 Zydrine 84 ..." + placeholder="Paste job dump here: Discovery Survey Probe I 800 468000 158,670,288 237,484,800 Tritanium 8888800 Pyerite 711200 ..." className="bg-gray-800 border-gray-600 text-white min-h-[120px]" rows={6} /> diff --git a/src/components/JobStatusNavigation.tsx b/src/components/JobStatusNavigation.tsx index 9eedc6a..3e6e505 100644 --- a/src/components/JobStatusNavigation.tsx +++ b/src/components/JobStatusNavigation.tsx @@ -74,7 +74,7 @@ const JobStatusNavigation: React.FC = ({ job }) => { e.stopPropagation(); handleStatusChange(previousStatus); }} - className={`${getStatusColor(previousStatus)} text-white px-4 py-2 rounded flex items-center justify-center gap-1 hover:opacity-80 transition-opacity w-32`} + className={`${getStatusColor(previousStatus)}/60 text-white px-4 py-2 rounded flex items-center justify-center gap-1 hover:opacity-80 transition-opacity w-32`} data-no-navigate title={`Move to ${previousStatus}`} > @@ -88,7 +88,7 @@ const JobStatusNavigation: React.FC = ({ job }) => { e.stopPropagation(); handleStatusChange(nextStatus); }} - className={`${getStatusColor(nextStatus)} text-white px-4 py-2 rounded flex items-center justify-center gap-1 hover:opacity-80 transition-opacity w-32`} + className={`${getStatusColor(nextStatus)}/60 text-white px-4 py-2 rounded flex items-center justify-center gap-1 hover:opacity-80 transition-opacity w-32`} data-no-navigate title={`Move to ${nextStatus}`} >