mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
* fix(web): fix sidebar tooltip pluralization * Rename property * Remove data-testid attribute * Fix variable type
24 lines
693 B
Svelte
24 lines
693 B
Svelte
<script lang="ts">
|
|
import { locale } from '$lib/stores/preferences.store.js';
|
|
import { s } from '$lib/utils.js';
|
|
import { type AlbumCountResponseDto, getAlbumCount } from '@immich/sdk';
|
|
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
|
|
|
|
export let albumCountType: keyof AlbumCountResponseDto;
|
|
|
|
const handleAlbumCount = async () => {
|
|
try {
|
|
return await getAlbumCount();
|
|
} catch {
|
|
return { owned: 0, shared: 0, notShared: 0 };
|
|
}
|
|
};
|
|
</script>
|
|
|
|
{#await handleAlbumCount()}
|
|
<LoadingSpinner />
|
|
{:then data}
|
|
<div>
|
|
<p>{data[albumCountType].toLocaleString($locale)} Album{s(data[albumCountType])}</p>
|
|
</div>
|
|
{/await}
|