Files
windmill/frontend/src/lib/components/DraftConflictAlert.svelte
T
Guilhem 52c31881fc feat: add alert actions and reduce alert padding (#11439)
* style: reduce alert padding

* feat: add alert actions rendered as buttons in the alert's colors

* fix: address review nits on alert actions and button tone

* fix: color split-button outline and divider by tone

* fix: apply tone hover and disabled states to the split-button chevron

* refactor: ignore button tone on split buttons
2026-09-30 14:01:47 +02:00

27 lines
826 B
Svelte

<script lang="ts">
import { Alert } from '$lib/components/common'
interface Props {
/** Take the draft the server holds, replacing what is on screen. */
onReload: () => void
/** Write what is on screen over the server's draft. */
onOverwrite: () => void
/** A resolution is in flight: neither answer is offered again until it settles. */
busy?: boolean
}
let { onReload, onOverwrite, busy = false }: Props = $props()
</script>
<Alert
type="warning"
title="Your draft changed elsewhere"
actions={[
{ label: 'Load the other version', variant: 'default', disabled: busy, onClick: onReload },
{ label: 'Keep mine', variant: 'default', disabled: busy, onClick: onOverwrite }
]}
>
It was saved from another tab or session since this one read it, so your changes here are no longer
being saved.
</Alert>