2023-09-20 13:16:33 +02:00
|
|
|
<script lang="ts">
|
2025-03-12 17:00:16 -04:00
|
|
|
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
|
2024-02-14 06:38:57 -08:00
|
|
|
import type { LibraryResponseDto } from '@immich/sdk';
|
2025-03-12 17:00:16 -04:00
|
|
|
import { Button, Field, Input } from '@immich/ui';
|
|
|
|
|
import { mdiRenameOutline } from '@mdi/js';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2023-09-20 13:16:33 +02:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
library: Partial<LibraryResponseDto>;
|
|
|
|
|
onCancel: () => void;
|
|
|
|
|
onSubmit: (library: Partial<LibraryResponseDto>) => void;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-12 17:00:16 -04:00
|
|
|
let { library, onCancel, onSubmit }: Props = $props();
|
|
|
|
|
|
|
|
|
|
let newName = $state(library.name);
|
2024-11-14 08:43:25 -06:00
|
|
|
|
|
|
|
|
const onsubmit = (event: Event) => {
|
|
|
|
|
event.preventDefault();
|
2025-03-12 17:00:16 -04:00
|
|
|
onSubmit({ ...library, name: newName });
|
2024-11-14 08:43:25 -06:00
|
|
|
};
|
2023-09-20 13:16:33 +02:00
|
|
|
</script>
|
|
|
|
|
|
2025-03-12 17:00:16 -04:00
|
|
|
<form {onsubmit} autocomplete="off">
|
|
|
|
|
<FullScreenModal icon={mdiRenameOutline} title={$t('rename')} onClose={onCancel}>
|
|
|
|
|
<Field label={$t('name')}>
|
|
|
|
|
<Input bind:value={newName} />
|
|
|
|
|
</Field>
|
|
|
|
|
|
|
|
|
|
{#snippet stickyBottom()}
|
|
|
|
|
<Button shape="round" fullWidth color="secondary" onclick={onCancel}>{$t('cancel')}</Button>
|
|
|
|
|
<Button shape="round" fullWidth type="submit">{$t('save')}</Button>
|
|
|
|
|
{/snippet}
|
|
|
|
|
</FullScreenModal>
|
2023-09-20 13:16:33 +02:00
|
|
|
</form>
|