import { UmbUserDetailRepository } from '../../repository/index.js';
import { html } from '../../../../../external/lit/index.js';
import { UmbEntityBulkActionBase } from '../../../../core/entity-bulk-action/index.js';
import { umbConfirmModal } from '../../../../core/modal/index.js';
export class UmbUserDeleteEntityBulkAction extends UmbEntityBulkActionBase {
    async execute() {
        if (this.selection.length === 0)
            return;
        await umbConfirmModal(this._host, {
            color: 'danger',
            headline: `Delete users?`,
            content: html `Are you sure you want to delete selected users?`,
            confirmLabel: 'Delete',
        });
        const repository = new UmbUserDetailRepository(this._host);
        //TODO: How should we handle bulk actions? right now we send a request per item we want to change.
        //TODO: For now we have to reload the page to see the update
        for (let index = 0; index < this.selection.length; index++) {
            const element = this.selection[index];
            await repository.delete(element);
        }
    }
}
export { UmbUserDeleteEntityBulkAction as api };
