feat: add bulk action toolbar component for applying gamme codes to selected items.

This commit is contained in:
Michael committed 2026-03-06 15:53:24 +01:00
1 parent cdc310223c
commit 34e8f4a767
1 file changed
+6 -2
@@ -17,12 +17,16 @@ interface BulkActionToolbarProps {
}
export function BulkActionToolbar({ selectedCodeins, onClearSelection }: BulkActionToolbarProps) {
const { setDraftGamme } = useGridStore();
const { batchSetDraftGamme } = useGridStore();
if (selectedCodeins.length === 0) return null;
const applyBulk = (code: GammeCode) => {
selectedCodeins.forEach((codein) => setDraftGamme(codein, code));
const changes = selectedCodeins.reduce((acc, codein) => {
acc[codein] = code;
return acc;
}, {} as Record<string, GammeCode>);
batchSetDraftGamme(changes);
onClearSelection();
};