import { render } from 'preact'; import { html } from 'htm/preact'; import { useState } from 'preact/hooks'; import eventBus from '../classes/event-bus.js'; function ParametersDialog() { const [serverUrl, setServerUrl] = useState('127.0.0.1:8081'); // Function to show the modal function showModal() { modal.style.display = 'block'; } // Function to hide the modal function hideModal() { modal.style.display = 'none'; } // Event listener for the close button function handleCloseClick() { hideModal(); } // Event listener for the submit button function handleOkClick () { const urlInput = document.getElementById('url-input').value; console.log('URL entered:', urlInput); hideModal(); } eventBus.subscribe('show-modal', function(data) { showModal(); }); return html` `; } export default ParametersDialog;