2023-05-17 13:07:17 -04:00
|
|
|
<script lang="ts">
|
2024-02-14 06:38:57 -08:00
|
|
|
import { type PersonResponseDto } from '@immich/sdk';
|
2023-07-01 00:50:47 -04:00
|
|
|
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
|
|
|
|
|
import Button from '../elements/buttons/button.svelte';
|
2024-04-29 23:38:15 +02:00
|
|
|
import SearchPeople from '$lib/components/faces-page/people-search.svelte';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2023-05-17 13:07:17 -04:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
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);
|
|
|
|
|
};
|
2023-05-17 13:07:17 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div
|
2024-04-29 23:38:15 +02:00
|
|
|
class="flex w-full h-14 place-items-center {suggestedPeople.length > 0
|
2023-10-24 17:53:49 +02:00
|
|
|
? 'rounded-t-lg dark:border-immich-dark-gray'
|
2024-11-14 08:43:25 -06:00
|
|
|
: 'rounded-lg'} bg-gray-100 p-2 dark:bg-gray-700 border border-gray-200 dark:border-immich-dark-gray"
|
2023-05-17 13:07:17 -04:00
|
|
|
>
|
2024-01-26 15:08:54 +01:00
|
|
|
<ImageThumbnail circle shadow url={thumbnailData} altText={person.name} widthStyle="2rem" heightStyle="2rem" />
|
2025-04-28 09:53:53 -04:00
|
|
|
<form class="ms-4 flex w-full justify-between gap-16" autocomplete="off" {onsubmit}>
|
2024-04-29 23:38:15 +02:00
|
|
|
<SearchPeople
|
|
|
|
|
bind:searchName={name}
|
|
|
|
|
bind:searchedPeopleLocal={suggestedPeople}
|
|
|
|
|
type="input"
|
|
|
|
|
numberPeopleToSearch={5}
|
|
|
|
|
inputClass="w-full gap-2 bg-gray-100 dark:bg-gray-700 dark:text-white"
|
|
|
|
|
bind:showLoadingSpinner={isSearchingPeople}
|
2023-07-01 00:50:47 -04:00
|
|
|
/>
|
2024-06-04 21:53:00 +02:00
|
|
|
<Button size="sm" type="submit">{$t('done')}</Button>
|
2023-07-01 00:50:47 -04:00
|
|
|
</form>
|
2023-05-17 13:07:17 -04:00
|
|
|
</div>
|