28 lines
571 B
Svelte
28 lines
571 B
Svelte
<script lang="ts">
|
|
interface Photo {
|
|
base64: string;
|
|
mediaType: string;
|
|
}
|
|
|
|
interface Props {
|
|
photos: Photo[];
|
|
onremove: (index: number) => void;
|
|
}
|
|
|
|
let { photos, onremove }: Props = $props();
|
|
</script>
|
|
|
|
{#if photos.length > 0}
|
|
<div class="flex flex-wrap gap-1">
|
|
{#each photos as _photo, i (i)}
|
|
<button
|
|
onclick={() => onremove(i)}
|
|
class="flex items-center gap-1 rounded bg-blue-600/30 px-1.5 py-0.5 text-[8px] text-blue-300"
|
|
>
|
|
<span>photo {i + 1}</span>
|
|
<span class="text-blue-400">×</span>
|
|
</button>
|
|
{/each}
|
|
</div>
|
|
{/if}
|