<script>
import OptKit from 'optkit@latest';
const testAlert = () => alert("alert.");
const testPrompt = async () => {
let answer = await prompt("prompt?");
if (answer) alert(answer);
};
const testConfirm = async (_) => {
let confirmed = await confirm("confirmed?");
if (confirmed) alert(confirmed);
};
const openMenu = async (e) => {
menu(e, [
{ label: "testAlert()", onClick: testAlert },
{ label: "testPrompt()", onClick: testPrompt },
{ label: "testConfirm()", onClick: testConfirm },
]);
};
</script>
<OptKit/>
<p>
<button on:click={testAlert}>
alert()
</button>
</p>
<p>
<button on:click={testPrompt}>
prompt()
</button>