flotilla/src/app/components/RelayIcon.svelte

22 lines
531 B
Svelte
Raw Normal View History

<script lang="ts">
2026-08-28 00:08:36 +00:00
import Server from "@assets/icons/server.svg?dataurl"
import ImageIcon from "@lib/components/ImageIcon.svelte"
2026-07-28 16:16:26 +00:00
import {relays} from "@app/core"
type Props = {
url: string
size?: number
class?: string
}
const {url, size = 7, ...props}: Props = $props()
2026-07-28 16:16:26 +00:00
const relay = $relays.one(url)
</script>
2026-01-16 22:17:38 +00:00
{#if $relay?.icon}
2026-08-28 00:08:36 +00:00
<ImageIcon {size} alt="" src={$relay?.icon} class="rounded-full {props.class}" />
2026-01-16 22:17:38 +00:00
{:else}
2026-08-28 00:08:36 +00:00
<ImageIcon size={size - 2} alt="" src={Server} class={props.class} />
2026-01-16 22:17:38 +00:00
{/if}