// ======================================== // BatchOperationToolbar Component // ======================================== // Toolbar for batch operations on prompts import { useIntl } from 'react-intl'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/Button'; import { Checkbox } from '@/components/ui/Checkbox'; import { Trash2, X } from 'lucide-react'; export interface BatchOperationToolbarProps { /** Number of selected items */ selectedCount: number; /** Whether all items are selected */ allSelected: boolean; /** Called when select all is toggled */ onSelectAll: (selected: boolean) => void; /** Called when clear selection is triggered */ onClearSelection: () => void; /** Called when batch delete is triggered */ onDelete: () => void; /** Whether delete operation is in progress */ isDeleting?: boolean; /** Optional className */ className?: string; } /** * BatchOperationToolbar component for bulk actions */ export function BatchOperationToolbar({ selectedCount, allSelected, onSelectAll, onClearSelection, onDelete, isDeleting = false, className, }: BatchOperationToolbarProps) { const { formatMessage } = useIntl(); if (selectedCount === 0) { return null; } return (
{/* Selection info and select all */}
onSelectAll(checked === true)} aria-label={formatMessage({ id: 'prompts.batch.selectAll' })} /> {formatMessage({ id: 'prompts.batch.selected' }, { count: selectedCount })}
{/* Action buttons */}
); } export default BatchOperationToolbar;