d6756f3d81
* feat(web): improved action bar actions * Update web/src/lib/components/photos-page/actions/delete-assets.svelte Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * update archive and favorite actions * feat: add un archive/favorite on associated pages * fix favorite action + use isAllArchived for photos * remove unneeded unarchive check --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
24 lines
935 B
Svelte
24 lines
935 B
Svelte
<script lang="ts">
|
|
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
|
import { bulkDownload } from '$lib/utils/asset-utils';
|
|
import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte';
|
|
import MenuOption from '../../shared-components/context-menu/menu-option.svelte';
|
|
import { getAssetControlContext } from '../asset-select-control-bar.svelte';
|
|
|
|
export let filename = 'immich';
|
|
export let sharedLinkKey: string | undefined = undefined;
|
|
export let menuItem = false;
|
|
|
|
const { getAssets, clearSelect } = getAssetControlContext();
|
|
|
|
const handleDownloadFiles = async () => {
|
|
await bulkDownload(filename, Array.from(getAssets()), clearSelect, sharedLinkKey);
|
|
};
|
|
</script>
|
|
|
|
{#if menuItem}
|
|
<MenuOption text="Download" on:click={handleDownloadFiles} />
|
|
{:else}
|
|
<CircleIconButton title="Download" logo={CloudDownloadOutline} on:click={handleDownloadFiles} />
|
|
{/if}
|