chore(web): migration svelte 5 syntax (#13883)

This commit is contained in:
Alex 2024-11-14 08:43:25 -06:00 committed by GitHub
parent 9203a61709
commit 0b3742cf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
310 changed files with 6435 additions and 4176 deletions

View file

@ -5,25 +5,37 @@
import SearchPeople from '$lib/components/faces-page/people-search.svelte';
import { t } from 'svelte-i18n';
export let person: PersonResponseDto;
export let name: string;
export let suggestedPeople: PersonResponseDto[];
export let thumbnailData: string;
export let isSearchingPeople: boolean;
export let onChange: (name: string) => void;
interface Props {
person: PersonResponseDto;
name: string;
suggestedPeople: PersonResponseDto[];
thumbnailData: string;
isSearchingPeople: boolean;
onChange: (name: string) => void;
}
let {
person,
name = $bindable(),
suggestedPeople = $bindable(),
thumbnailData,
isSearchingPeople = $bindable(),
onChange,
}: Props = $props();
const onsubmit = (event: Event) => {
event.preventDefault();
onChange(name);
};
</script>
<div
class="flex w-full h-14 place-items-center {suggestedPeople.length > 0
? 'rounded-t-lg dark:border-immich-dark-gray'
: 'rounded-lg'} bg-gray-100 p-2 dark:bg-gray-700"
: 'rounded-lg'} bg-gray-100 p-2 dark:bg-gray-700 border border-gray-200 dark:border-immich-dark-gray"
>
<ImageThumbnail circle shadow url={thumbnailData} altText={person.name} widthStyle="2rem" heightStyle="2rem" />
<form
class="ml-4 flex w-full justify-between gap-16"
autocomplete="off"
on:submit|preventDefault={() => onChange(name)}
>
<form class="ml-4 flex w-full justify-between gap-16" autocomplete="off" {onsubmit}>
<SearchPeople
bind:searchName={name}
bind:searchedPeopleLocal={suggestedPeople}