diff --git a/src/components/crews/CrewManagement.tsx b/src/components/crews/CrewManagement.tsx index 9f654435..74a61de2 100644 --- a/src/components/crews/CrewManagement.tsx +++ b/src/components/crews/CrewManagement.tsx @@ -5,8 +5,7 @@ import { useRouter } from "next/navigation"; import { supabase } from "@/utils/supabase/client"; import { Button } from "@/components/ui/button"; import { - Circle, - CheckCircle, + Settings, PlusIcon, Trash2Icon, UserIcon, @@ -29,9 +28,7 @@ import { ChatBubbleIcon } from "@radix-ui/react-icons"; export function CrewManagement({ initialCrews, - onCrewSelect, onCrewUpdate, - selectedCrew, }: CrewManagementProps) { const [crews, setCrews] = useState(initialCrews); const [isDialogOpen, setIsDialogOpen] = useState(false); @@ -68,10 +65,6 @@ export function CrewManagement({ const updatedCrews = crews.filter((crew) => crew.id !== id); setCrews(updatedCrews); - if (selectedCrew?.id === id) { - onCrewSelect(null); - } - onCrewUpdate(updatedCrews); toast({ title: "Crew deleted", @@ -171,15 +164,10 @@ export function CrewManagement({ {crew.name}

diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index 7fc31f7a..6831f25d 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -24,7 +24,6 @@ export default function Dashboard() { const [hasClonedAnalyzer, setHasClonedAnalyzer] = useState(false); const [error, setError] = useState(null); const [isLoading, setIsLoading] = useState(true); - const [selectedCrew, setSelectedCrew] = useState(null); const [isSheetOpen, setIsSheetOpen] = useState(false); const fetchCrews = useCallback(async () => { @@ -85,10 +84,6 @@ export default function Dashboard() { initializeDashboard(); }, [fetchCrews, checkClonedAnalyzer]); - const handleCrewSelect = useCallback((crew: Crew | null) => { - setSelectedCrew(crew); - }, []); - const handleCloneComplete = useCallback(() => { setHasClonedAnalyzer(true); fetchCrews(); @@ -97,9 +92,6 @@ export default function Dashboard() { const handleCrewsUpdated = useCallback( (updatedCrews: Crew[]) => { setCrews(updatedCrews); - if (updatedCrews.length === 0) { - setSelectedCrew(null); - } checkClonedAnalyzer(); }, [checkClonedAnalyzer] @@ -136,9 +128,7 @@ export default function Dashboard() { ) : ( )} diff --git a/src/types/supabase.ts b/src/types/supabase.ts index 961998f6..323807c9 100644 --- a/src/types/supabase.ts +++ b/src/types/supabase.ts @@ -10,9 +10,7 @@ export interface Crew { // Interface for props of the CrewManagement component export interface CrewManagementProps { initialCrews: Crew[] - onCrewSelect: (crew: Crew | null) => void onCrewUpdate: (updatedCrews: Crew[]) => void - selectedCrew: Crew | null } // Interface for props of the CrewForm component