MapComplete/src/UI/Image/ImageCarousel.svelte

26 lines
885 B
Svelte
Raw Normal View History

<script lang="ts">
2024-12-17 04:05:15 +01:00
import { Store, UIEventSource } from "../../Logic/UIEventSource.js"
import type { ProvidedImage } from "../../Logic/ImageProviders/ImageProvider"
import type { SpecialVisualizationState } from "../SpecialVisualization"
import DeletableImage from "./DeletableImage.svelte"
import LoadingPlaceholder from "../Base/LoadingPlaceholder.svelte"
export let images: Store<ProvidedImage[]>
export let state: SpecialVisualizationState
2024-12-17 04:05:15 +01:00
export let tags: UIEventSource<Record<string, string>>
export let estimated: Store<number>
</script>
2025-01-28 15:42:34 +01:00
{#if $estimated > 0 && $images.length < 1}
<LoadingPlaceholder />
{:else}
<div class="w-full overflow-x-auto" style="scroll-snap-type: x proximity">
<div class="flex space-x-2">
{#each $images as image (image.url)}
<DeletableImage {image} {state} {tags} />
{/each}
</div>
</div>
{/if}