import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Pencil, X, CheckSquare, Trash2 } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; interface SelectionActionBarProps { selectedCount: number; totalCount: number; onEdit: () => void; onDelete: () => void; onClear: () => void; onSelectAll: () => void; } export function SelectionActionBar({ selectedCount, totalCount, onEdit, onDelete, onClear, onSelectAll, }: SelectionActionBarProps) { const [showDeleteDialog, setShowDeleteDialog] = useState(false); if (selectedCount === 0) return null; const allSelected = selectedCount === totalCount; const handleDeleteClick = () => { setShowDeleteDialog(true); }; const handleConfirmDelete = () => { setShowDeleteDialog(false); onDelete(); }; return ( <>
{selectedCount} feature{selectedCount !== 1 ? 's' : ''} selected
{!allSelected && ( )}
{/* Delete Confirmation Dialog */} Delete Selected Features? Are you sure you want to permanently delete {selectedCount} feature {selectedCount !== 1 ? 's' : ''}? This action cannot be undone. ); }