diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 80f5ed7..3862573 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,4 +1,3 @@ - import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; @@ -31,6 +30,10 @@ const Index = () => { const [editingJob, setEditingJob] = useState(null); const [selectedJobId, setSelectedJobId] = useState(null); const [showBatchForm, setShowBatchForm] = useState(false); + const [collapsedGroups, setCollapsedGroups] = useState>(() => { + const saved = localStorage.getItem('jobGroupsCollapsed'); + return saved ? JSON.parse(saved) : {}; + }); const selectedJob = useJob(selectedJobId); @@ -185,11 +188,6 @@ const Index = () => { return groups; }, {} as Record); - const [collapsedGroups, setCollapsedGroups] = useState>(() => { - const saved = localStorage.getItem('jobGroupsCollapsed'); - return saved ? JSON.parse(saved) : {}; - }); - const toggleGroup = (status: string) => { const newState = { ...collapsedGroups, [status]: !collapsedGroups[status] }; setCollapsedGroups(newState);