mirror of
https://github.com/immich-app/immich.git
synced 2026-07-15 09:32:33 +00:00
33 lines
930 B
Svelte
33 lines
930 B
Svelte
<script lang="ts">
|
|
import { handleRemoveSharedLinkAssets } from '$lib/services/shared-link.service';
|
|
import { getAssetControlContext } from '$lib/utils/context';
|
|
import { type SharedLinkResponseDto } from '@immich/sdk';
|
|
import { IconButton } from '@immich/ui';
|
|
import { mdiDeleteOutline } from '@mdi/js';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
interface Props {
|
|
sharedLink: SharedLinkResponseDto;
|
|
}
|
|
|
|
let { sharedLink = $bindable() }: Props = $props();
|
|
|
|
const { getAssets, clearSelect } = getAssetControlContext();
|
|
|
|
const handleSelect = async () => {
|
|
const assetIds = getAssets().map(({ id }) => id);
|
|
const success = await handleRemoveSharedLinkAssets(sharedLink, assetIds);
|
|
if (success) {
|
|
clearSelect();
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<IconButton
|
|
shape="round"
|
|
color="secondary"
|
|
variant="ghost"
|
|
aria-label={$t('remove_from_shared_link')}
|
|
onclick={handleSelect}
|
|
icon={mdiDeleteOutline}
|
|
/>
|