mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-12 01:36:43 +02:00
feat: add bulk action toolbar component for applying gamme codes to selected items.
This commit is contained in:
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();
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user