File size: 1,444 Bytes
43a06dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script lang="ts">
    import { t } from "$lib/i18n/translations";
    import { createDialog } from "$lib/state/dialogs";
    import { resetSettings } from "$lib/state/settings";

    import IconTrash from "@tabler/icons-svelte/IconTrash.svelte";

    const resetDialog = () => {
        createDialog({
            id: "wipe-confirm",
            type: "small",
            icon: "warn-red",
            title: $t("dialog.reset.title"),
            bodyText: $t("dialog.reset.body"),
            buttons: [
                {
                    text: $t("button.cancel"),
                    main: false,
                    action: () => {},
                },
                {
                    text: $t("button.reset"),
                    color: "red",
                    main: true,
                    timeout: 2000,
                    action: () => resetSettings(),
                },
            ],
        });
    };
</script>

<button id="setting-button-reset" class="button" on:click={resetDialog}>
    <IconTrash />
    {$t("button.reset")}
</button>

<style>
    #setting-button-reset {
        background-color: var(--red);
        color: var(--white);
        width: max-content;
        text-align: start;
    }

    #setting-button-reset:hover {
        background-color: var(--dark-red);
    }

    #setting-button-reset :global(svg) {
        stroke-width: 2px;
        height: 24px;
        width: 24px;
    }
</style>