flotilla/src/app/components/RoomImage.svelte

35 lines
992 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 Volume from "@assets/icons/volume.svg?dataurl"
2025-11-06 00:59:17 +00:00
import Icon from "@lib/components/Icon.svelte"
import ImageIcon from "@lib/components/ImageIcon.svelte"
2026-07-28 16:16:26 +00:00
import {rooms} from "@app/core"
2025-11-06 00:59:17 +00:00
interface Props {
h: string
url: string
size?: number
fallbackIcon?: string
2025-11-06 00:59:17 +00:00
}
const {url, h, size = 5, fallbackIcon = Hashtag}: Props = $props()
2025-11-06 00:59:17 +00:00
2026-07-28 16:16:26 +00:00
const room = $rooms.forRoom(url, h)
const picture = $derived($room?.meta?.picture())
const isVoiceRoom = $derived($room?.meta?.hasLivekit())
2025-11-06 00:59:17 +00:00
</script>
{#if isVoiceRoom}
<div class="flex shrink-0 items-center gap-1.5">
2026-03-16 20:39:47 +00:00
<Icon size={size + 1} icon={Volume} />
2026-07-28 16:16:26 +00:00
{#if picture}
<span class="text-base">/</span>
2026-07-28 16:16:26 +00:00
<ImageIcon src={picture} {size} alt="" class="rounded-xl" />
{/if}
</div>
2026-07-28 16:16:26 +00:00
{:else if picture}
<ImageIcon src={picture} {size} alt="" class="rounded-xl" />
2025-11-06 00:59:17 +00:00
{:else}
<Icon icon={fallbackIcon} {size} />
2025-11-06 00:59:17 +00:00
{/if}