flotilla/src/app/components/AlertDelete.svelte

21 lines
509 B
Svelte
Raw Normal View History

2025-02-25 21:36:32 +00:00
<script lang="ts">
import Confirm from "@lib/components/Confirm.svelte"
import type {Alert} from "@app/core/state"
import {deleteAlert} from "@app/core/commands"
import {pushToast} from "@app/util/toast"
2025-02-25 21:36:32 +00:00
type Props = {
alert: Alert
}
const {alert}: Props = $props()
const confirm = () => {
deleteAlert(alert)
2025-02-25 21:36:32 +00:00
pushToast({message: "Your alert has been deleted!"})
history.back()
}
</script>
<Confirm {confirm} message="You'll no longer receive messages for this alert." />