Refactor: Extract common logic and reduce file size

Refactors `Index.tsx` and `JobCardHeader.tsx` to reduce bloat and extract common logic, such as job status coloring, into reusable components or utility functions. This improves code maintainability and readability.
This commit is contained in:
gpt-engineer-app[bot]
2025-07-07 17:49:07 +00:00
committed by PhatPhuckDave
parent cb32ccaba9
commit ec8430189a
12 changed files with 480 additions and 532 deletions

View File

@@ -4,6 +4,8 @@ import { formatISK } from '@/utils/priceUtils';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { useNavigate } from 'react-router-dom';
import { ChevronDown, ChevronUp } from 'lucide-react';
import { getStatusBackgroundColor } from '@/utils/jobStatusUtils';
interface RecapPopoverProps {
title: string;
@@ -19,6 +21,7 @@ const RecapPopover: React.FC<RecapPopoverProps> = ({
calculateJobValue
}) => {
const navigate = useNavigate();
const [sortDescending, setSortDescending] = useState(true);
const jobContributions = jobs
.map(job => ({