flotilla/src/app/components/RoomImage.svelte

23 lines
540 B
Svelte
Raw Normal View History

2025-11-06 00:59:17 +00:00
<script lang="ts">
import Hashtag from "@assets/icons/hashtag.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
import ImageIcon from "@lib/components/ImageIcon.svelte"
import {deriveRoom} from "@app/core/state"
interface Props {
h: string
url: string
size?: number
2025-11-06 00:59:17 +00:00
}
const {url, h, size = 5}: Props = $props()
2025-11-06 00:59:17 +00:00
const room = deriveRoom(url, h)
</script>
{#if $room.picture}
2025-11-12 01:34:15 +00:00
<ImageIcon src={$room.picture} {size} alt="Room icon" class="rounded-lg" />
2025-11-06 00:59:17 +00:00
{:else}
<Icon icon={Hashtag} {size} />
2025-11-06 00:59:17 +00:00
{/if}