|
|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
import SegmentedControl from '$lib/ui/inputs/SegmentedControl.svelte';
|
|
|
|
|
import Card from '$lib/ui/layout/Card.svelte';
|
|
|
|
|
import Button from '$lib/ui/atoms/Button.svelte';
|
|
|
|
|
import { toasts } from '$lib/stores/toasts';
|
|
|
|
|
import { success as toastSuccess } from '$lib/stores/toasts';
|
|
|
|
|
|
|
|
|
|
export let data: {
|
|
|
|
|
pref: { freq: 'off' | 'daily' | 'weekly' | 'weekdays'; time: string | null };
|
|
|
|
|
@ -13,7 +13,7 @@
|
|
|
|
|
|
|
|
|
|
let freq: 'off' | 'daily' | 'weekly' | 'weekdays' = data.pref.freq;
|
|
|
|
|
let time: string = data.pref.time ?? '08:30';
|
|
|
|
|
$: if (form?.success) { try { toasts.success('Preferencias guardadas.'); } catch {} }
|
|
|
|
|
$: if (form?.success) { try { toastSuccess('Preferencias guardadas.'); } catch {} }
|
|
|
|
|
|
|
|
|
|
const options = [
|
|
|
|
|
{ label: 'Apagado', value: 'off' },
|
|
|
|
|
@ -45,9 +45,6 @@
|
|
|
|
|
{#if form?.error}
|
|
|
|
|
<div style="color: var(--color-danger);">{form.error}</div>
|
|
|
|
|
{/if}
|
|
|
|
|
{#if form?.success}
|
|
|
|
|
<div style="color: var(--color-success);">Preferencias guardadas.</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<Button type="submit" variant="primary">Guardar</Button>
|
|
|
|
|
|