mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
* chore(deps): update dependency eslint-plugin-svelte to v3 * chore: linting * chore: rebase --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Dietzler <mail@ddietzler.dev> Co-authored-by: Zack Pollard <zackpollard@ymail.com>
29 lines
941 B
Svelte
29 lines
941 B
Svelte
<script lang="ts">
|
|
import { UserAvatarColor, type UserResponseDto } from '@immich/sdk';
|
|
import { t } from 'svelte-i18n';
|
|
import FullScreenModal from '../full-screen-modal.svelte';
|
|
import UserAvatar from '../user-avatar.svelte';
|
|
|
|
interface Props {
|
|
user: UserResponseDto;
|
|
onClose: () => void;
|
|
onChoose: (color: UserAvatarColor) => void;
|
|
}
|
|
|
|
let { user, onClose, onChoose }: Props = $props();
|
|
|
|
const colors: UserAvatarColor[] = Object.values(UserAvatarColor);
|
|
</script>
|
|
|
|
<FullScreenModal title={$t('select_avatar_color')} width="auto" {onClose}>
|
|
<div class="flex items-center justify-center mt-4">
|
|
<div class="grid grid-cols-2 md:grid-cols-5 gap-4">
|
|
{#each colors as color (color)}
|
|
<button type="button" onclick={() => onChoose(color)}>
|
|
<UserAvatar label={color} {user} {color} size="xl" showProfileImage={false} />
|
|
</button>
|
|
{/each}
|
|
</div>
|
|
</div>
|
|
</FullScreenModal>
|