2024-07-20 15:01:13 +01:00
|
|
|
<script lang="ts">
|
2024-07-20 16:48:17 +01:00
|
|
|
import { t } from "$lib/i18n/translations";
|
|
|
|
import { resetSettings } from "$lib/state/settings";
|
|
|
|
|
|
|
|
import IconTrash from "@tabler/icons-svelte/IconTrash.svelte";
|
|
|
|
|
|
|
|
import { createDialog } from "$lib/dialogs";
|
|
|
|
|
|
|
|
const resetDialog = () => {
|
|
|
|
createDialog({
|
|
|
|
id: "wipe-confirm",
|
|
|
|
type: "small",
|
|
|
|
icon: "warn-red",
|
|
|
|
title: $t("dialog.erase.title"),
|
|
|
|
bodyText: $t("dialog.erase.body"),
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: $t("dialog.button.cancel"),
|
|
|
|
main: false,
|
|
|
|
action: () => {},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: $t("dialog.button.erase"),
|
|
|
|
color: "red",
|
|
|
|
main: true,
|
|
|
|
action: () => resetSettings(),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
|
|
|
};
|
2024-07-20 15:01:13 +01:00
|
|
|
</script>
|
|
|
|
|
2024-07-20 16:48:17 +01:00
|
|
|
<button id="setting-button-reset" class="button" on:click={resetDialog}>
|
|
|
|
<IconTrash />
|
|
|
|
{$t("settings.advanced.reset")}
|
2024-07-20 15:01:13 +01:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<style>
|
2024-07-20 16:48:17 +01:00
|
|
|
#setting-button-reset {
|
2024-07-20 15:01:13 +01:00
|
|
|
background-color: var(--red);
|
|
|
|
color: var(--white);
|
|
|
|
width: max-content;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
2024-07-20 16:48:17 +01:00
|
|
|
#setting-button-reset:hover {
|
2024-07-20 15:01:13 +01:00
|
|
|
background-color: var(--dark-red);
|
|
|
|
}
|
2024-07-20 16:48:17 +01:00
|
|
|
|
|
|
|
#setting-button-reset :global(svg) {
|
|
|
|
stroke-width: 2px;
|
|
|
|
height: 24px;
|
|
|
|
width: 24px;
|
|
|
|
}
|
2024-07-20 15:01:13 +01:00
|
|
|
</style>
|