diff --git a/src/components/modal/ConfirmationModal.ts b/src/components/modal/ConfirmationModal.ts deleted file mode 100644 index 2ee89d7..0000000 --- a/src/components/modal/ConfirmationModal.ts +++ /dev/null @@ -1,84 +0,0 @@ -import globalCss from '../../assets/styles/style.css?inline'; - -export class ConfirmationModal extends HTMLElement { - private _title: string = ''; - private _content: string = ''; - private _onConfirm: () => void = () => {}; - private _onCancel: () => void = () => {}; - - constructor() { - super(); - this.attachShadow({ mode: 'open' }); - } - - configure(title: string, content: string, onConfirm: () => void, onCancel: () => void) { - this._title = title; - this._content = content; - this._onConfirm = onConfirm; - this._onCancel = onCancel; - this.render(); - } - - render() { - if (!this.shadowRoot) return; - - this.shadowRoot.innerHTML = ` - - -
- `; - - this.shadowRoot.querySelector('#confirm-button')?.addEventListener('click', () => { - this._onConfirm(); - this.remove(); - }); - - this.shadowRoot.querySelector('#cancel-button')?.addEventListener('click', () => { - this._onCancel(); - this.remove(); - }); - } -} - -customElements.define('confirmation-modal', ConfirmationModal); diff --git a/src/components/modal/LoginModal.ts b/src/components/modal/LoginModal.ts deleted file mode 100644 index bf159a2..0000000 --- a/src/components/modal/LoginModal.ts +++ /dev/null @@ -1,82 +0,0 @@ -import globalCss from '../../assets/styles/style.css?inline'; -import ModalService from '../../services/modal.service'; - -export class LoginModal extends HTMLElement { - private _device1: string = ''; - private _device2: string = ''; - - constructor() { - super(); - this.attachShadow({ mode: 'open' }); - } - - set devices(data: { device1: string; device2: string }) { - this._device1 = data.device1; - this._device2 = data.device2; - this.render(); - } - - connectedCallback() { - this.render(); - } - - render() { - if (!this.shadowRoot) return; - - this.shadowRoot.innerHTML = ` - - -${value.previous_value || 'null'}
- ${value.new_value}
- -${value.previous_value}
- +${value.new_value}
- Confirmation de l'appairage pour le processus ${processId.substring(0, 8)}...
`; - - // Récupération des emojis (simplifié) - // Note: Dans ton ancien code, tu récupérais les membres et affichais les emojis. - // Ici on utilise notre modale générique. - - const confirmAction = async () => { - console.log('Pairing confirmed via Modal'); - // Ajouter ici la logique de confirmation si nécessaire - }; - - const cancelAction = async () => { - console.log('Pairing cancelled via Modal'); - await this.closeConfirmationModal(); - }; - - // On utilise showConfirmationModal qui fait tout le travail - await this.showConfirmationModal({ - title: 'Confirm Pairing', - content: contentHtml, - confirmText: 'Valider', - cancelText: 'Refuser', - }); - } - - async showConfirmationModal(options: ConfirmationModalOptions, fullscreen: boolean = false): Promise