mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(web): migration svelte 5 syntax (#13883)
This commit is contained in:
parent
9203a61709
commit
0b3742cf13
310 changed files with 6435 additions and 4176 deletions
|
|
@ -3,18 +3,27 @@
|
|||
import Button from '../elements/buttons/button.svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
export let library: Partial<LibraryResponseDto>;
|
||||
export let onCancel: () => void;
|
||||
export let onSubmit: (library: Partial<LibraryResponseDto>) => void;
|
||||
interface Props {
|
||||
library: Partial<LibraryResponseDto>;
|
||||
onCancel: () => void;
|
||||
onSubmit: (library: Partial<LibraryResponseDto>) => void;
|
||||
}
|
||||
|
||||
let { library = $bindable(), onCancel, onSubmit }: Props = $props();
|
||||
|
||||
const onsubmit = (event: Event) => {
|
||||
event.preventDefault();
|
||||
onSubmit({ ...library });
|
||||
};
|
||||
</script>
|
||||
|
||||
<form on:submit|preventDefault={() => onSubmit({ ...library })} autocomplete="off" class="m-4 flex flex-col gap-2">
|
||||
<form {onsubmit} autocomplete="off" class="m-4 flex flex-col gap-2">
|
||||
<div class="flex flex-col gap-2">
|
||||
<label class="immich-form-label" for="path">{$t('name')}</label>
|
||||
<input class="immich-form-input" id="name" name="name" type="text" bind:value={library.name} />
|
||||
</div>
|
||||
<div class="flex w-full justify-end gap-2 pt-2">
|
||||
<Button size="sm" color="gray" on:click={onCancel}>{$t('cancel')}</Button>
|
||||
<Button size="sm" color="gray" onclick={onCancel}>{$t('cancel')}</Button>
|
||||
<Button size="sm" type="submit">{$t('save')}</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue