refactor: albums-list (#23765)

This commit is contained in:
Jason Rasmussen
2025-11-10 11:49:59 -05:00
committed by GitHub
parent dd393c8346
commit a4e65a7ea8
4 changed files with 74 additions and 99 deletions

View File

@@ -1,6 +1,21 @@
import { downloadArchive } from '$lib/utils/asset-utils';
import { getFormatter } from '$lib/utils/i18n';
import type { AlbumResponseDto } from '@immich/sdk';
import { modalManager } from '@immich/ui';
export const handleDownloadAlbum = async (album: AlbumResponseDto) => {
await downloadArchive(`${album.albumName}.zip`, { albumId: album.id });
};
export const handleConfirmAlbumDelete = async (album: AlbumResponseDto) => {
const $t = await getFormatter();
const confirmation =
album.albumName.length > 0
? $t('album_delete_confirmation', { values: { album: album.albumName } })
: $t('unnamed_album_delete_confirmation');
const description = $t('album_delete_confirmation_description');
const prompt = `${confirmation} ${description}`;
return modalManager.showDialog({ prompt });
};