56b85f7479
* Work in progress - super quick asset store->state * bugfix: deep linking to timeline, on scrub stop * format, remove stale * disable test, todo: fix test * remove unused import * Fix merge * lint * lint * lint * Default to non-wasm layout * lint * intobs fix * fix rejected promise * Review comments, static import wasm * Back to dynamic * try top-level-await * back to the first solution, with more finesse * comment out wasm for now * back out the wasm/thumbhash/thumbnail changes * lint * Fully remove wasm * lockfile --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
30 lines
1.0 KiB
Svelte
30 lines
1.0 KiB
Svelte
<script lang="ts">
|
|
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
|
import { type AssetStore, isSelectingAllAssets } from '$lib/stores/assets-store.svelte';
|
|
import { mdiSelectAll, mdiSelectRemove } from '@mdi/js';
|
|
import { selectAllAssets, cancelMultiselect } from '$lib/utils/asset-utils';
|
|
import { t } from 'svelte-i18n';
|
|
import type { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
|
|
|
|
interface Props {
|
|
assetStore: AssetStore;
|
|
assetInteraction: AssetInteraction;
|
|
}
|
|
|
|
let { assetStore, assetInteraction }: Props = $props();
|
|
|
|
const handleSelectAll = async () => {
|
|
await selectAllAssets(assetStore, assetInteraction);
|
|
};
|
|
|
|
const handleCancel = () => {
|
|
cancelMultiselect(assetInteraction);
|
|
};
|
|
</script>
|
|
|
|
{#if $isSelectingAllAssets}
|
|
<CircleIconButton title={$t('unselect_all')} icon={mdiSelectRemove} onclick={handleCancel} />
|
|
{:else}
|
|
<CircleIconButton title={$t('select_all')} icon={mdiSelectAll} onclick={handleSelectAll} />
|
|
{/if}
|