Cleanup web import

This commit is contained in:
ZXY101
2023-10-03 11:17:26 +02:00
parent 9bbfe42934
commit 50ea6c49f5
3 changed files with 22 additions and 13 deletions

View File

@@ -22,6 +22,6 @@
{$confirmationPopupStore?.message}
</h3>
<Button color="red" class="mr-2" on:click={$confirmationPopupStore?.onConfirm}>Yes</Button>
<Button color="alternative">No</Button>
<Button color="alternative" on:click={$confirmationPopupStore?.onCancel}>No</Button>
</div>
</Modal>

View File

@@ -4,13 +4,15 @@ type ConfirmationPopup = {
open: boolean;
message: string;
onConfirm?: () => void;
onCancel?: () => void;
};
export const confirmationPopupStore = writable<ConfirmationPopup | undefined>(undefined);
export function promptConfirmation(message: string, onConfirm?: () => void) {
export function promptConfirmation(message: string, onConfirm?: () => void, onCancel?: () => void) {
confirmationPopupStore.set({
open: true,
message,
onConfirm
onConfirm,
onCancel
});
}