2022-12-09 15:51:42 -05:00
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
import Button from '$lib/components/elements/buttons/button.svelte';
|
2023-12-14 17:55:15 +01:00
|
|
|
import type { ResetOptions } from '$lib/utils/dipatch';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2022-12-09 15:51:42 -05:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
showResetToDefault?: boolean;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
onReset: (options: ResetOptions) => void;
|
|
|
|
|
onSave: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { showResetToDefault = true, disabled = false, onReset, onSave }: Props = $props();
|
2022-12-09 15:51:42 -05:00
|
|
|
</script>
|
|
|
|
|
|
2023-07-18 13:19:39 -05:00
|
|
|
<div class="mt-8 flex justify-between gap-2">
|
2023-07-01 00:50:47 -04:00
|
|
|
<div class="left">
|
|
|
|
|
{#if showResetToDefault}
|
|
|
|
|
<button
|
2024-05-27 09:06:15 +02:00
|
|
|
type="button"
|
2024-11-14 08:43:25 -06:00
|
|
|
onclick={() => onReset({ default: true })}
|
2023-07-18 13:19:39 -05:00
|
|
|
class="bg-none text-sm font-medium text-immich-primary hover:text-immich-primary/75 dark:text-immich-dark-primary hover:dark:text-immich-dark-primary/75"
|
2023-07-01 00:50:47 -04:00
|
|
|
>
|
2024-06-24 15:50:01 +02:00
|
|
|
{$t('reset_to_default')}
|
2023-07-01 00:50:47 -04:00
|
|
|
</button>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2022-12-09 15:51:42 -05:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<div class="right">
|
2024-11-14 08:43:25 -06:00
|
|
|
<Button {disabled} size="sm" color="gray" onclick={() => onReset({ default: false })}>{$t('reset')}</Button>
|
|
|
|
|
<Button type="submit" {disabled} size="sm" onclick={() => onSave()}>{$t('save')}</Button>
|
2023-07-01 00:50:47 -04:00
|
|
|
</div>
|
2022-12-09 15:51:42 -05:00
|
|
|
</div>
|