import { notifySuccess } from '@/portainer/services/notifications'; import { AddButton } from '@@/buttons'; import { DeleteButton } from '@@/buttons/DeleteButton'; import { EdgeJob } from '../types'; import { useDeleteEdgeJobsMutation } from './useDeleteEdgeJobsMutation'; export function TableActions({ selectedItems, }: { selectedItems: Array; }) { const removeMutation = useDeleteEdgeJobsMutation(); return (
handleRemove(selectedItems)} data-cy="remove-edge-jobs-button" /> Add Edge job
); async function handleRemove(selectedItems: Array) { const ids = selectedItems.map((item) => item.Id); removeMutation.mutate(ids, { onSuccess: () => { notifySuccess('Success', 'Edge Job(s) removed'); }, }); } }