Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738<script lang="ts"> import Modal from "$lib/components/ui/Modal.svelte"; import Button, { type ButtonVariants } from "$lib/components/ui/Button.svelte";
interface Props { open?: boolean; title: string; description?: string; confirmLabel: string; variant?: ButtonVariants["variant"]; cancelLabel?: string; loading?: boolean; onconfirm: () => void; }
let { open = $bindable(false), title, description, confirmLabel, variant = "danger", cancelLabel = "Cancel", loading = false, onconfirm }: Props = $props();</script>
{#snippet footer()} <Button class="flex-1" disabled={loading} onclick={() => (open = false)}> {cancelLabel} </Button> <Button {variant} class="flex-1" {loading} onclick={onconfirm}> {confirmLabel} </Button>{/snippet}
<Modal bind:open {title} {description} {footer}></Modal>