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
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
export let person: PersonResponseDto;
|
2023-09-23 06:58:51 +02:00
|
|
|
export let name: string;
|
2024-04-29 23:38:15 +02:00
|
|
|
export let suggestedPeople: PersonResponseDto[];
|
2024-01-26 15:08:54 +01:00
|
|
|
export let thumbnailData: string;
|
2024-04-29 23:38:15 +02:00
|
|
|
export let isSearchingPeople: boolean;
|
2024-09-20 23:02:58 +02:00
|
|
|
export let onChange: (name: string) => void;
|
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'
|
2023-09-23 06:58:51 +02:00
|
|
|
: 'rounded-lg'} bg-gray-100 p-2 dark:bg-gray-700"
|
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" />
|
2023-07-01 00:50:47 -04:00
|
|
|
<form
|
2023-07-18 13:19:39 -05:00
|
|
|
class="ml-4 flex w-full justify-between gap-16"
|
2023-07-01 00:50:47 -04:00
|
|
|
autocomplete="off"
|
2024-09-20 23:02:58 +02:00
|
|
|
on:submit|preventDefault={() => onChange(name)}
|
2023-07-01 00:50:47 -04:00
|
|
|
>
|
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>
|