2026-03-12 23:41:07 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {Snippet} from "svelte"
|
|
|
|
|
import {page} from "$app/stores"
|
|
|
|
|
import {goto} from "$app/navigation"
|
|
|
|
|
import {displayRelayUrl} from "@welshman/util"
|
|
|
|
|
import ArrowLeft from "@assets/icons/arrow-left.svg?dataurl"
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
|
|
|
|
import PageBar from "@lib/components/PageBar.svelte"
|
2026-05-25 19:18:51 +00:00
|
|
|
import RelayIcon from "@app/components/RelayIcon.svelte"
|
2026-06-08 22:33:38 +00:00
|
|
|
import {decodeRelay} from "@app/relays"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {makeSpacePath} from "@app/routes"
|
2026-03-12 23:41:07 +00:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
back?: () => unknown
|
2026-05-25 19:18:51 +00:00
|
|
|
leading?: Snippet
|
2026-03-12 23:41:07 +00:00
|
|
|
title?: Snippet
|
|
|
|
|
action?: Snippet
|
|
|
|
|
[key: string]: any
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-25 19:18:51 +00:00
|
|
|
const {back = () => goto(makeSpacePath(url)), leading, title, action, ...props}: Props = $props()
|
2026-03-12 23:41:07 +00:00
|
|
|
|
|
|
|
|
const url = decodeRelay($page.params.relay!)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<PageBar {...props}>
|
|
|
|
|
<div class="flex">
|
2026-03-13 16:11:08 +00:00
|
|
|
<Button onclick={back} class="place-self-start pr-3 md:hidden">
|
2026-03-12 23:41:07 +00:00
|
|
|
<Icon icon={ArrowLeft} size={7} />
|
|
|
|
|
</Button>
|
2026-06-17 16:08:58 +00:00
|
|
|
<div class="flex grow items-center justify-between gap-4">
|
|
|
|
|
<div class="flex min-w-0 flex-col">
|
|
|
|
|
<div class="flex min-w-0 items-start gap-2">
|
|
|
|
|
<RelayIcon {url} size={5} class="shrink-0 rounded-full md:hidden" />
|
|
|
|
|
<div class="hidden shrink-0 md:flex md:items-center">
|
2026-05-25 19:18:51 +00:00
|
|
|
{@render leading?.()}
|
|
|
|
|
</div>
|
2026-06-17 16:08:58 +00:00
|
|
|
<div class="min-w-0">
|
|
|
|
|
{@render title?.()}
|
|
|
|
|
</div>
|
2026-03-12 23:41:07 +00:00
|
|
|
</div>
|
2026-06-17 16:08:58 +00:00
|
|
|
<div class="text-xs text-primary pl-7 md:hidden">
|
2026-03-12 23:41:07 +00:00
|
|
|
{displayRelayUrl(url)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-06-17 16:08:58 +00:00
|
|
|
<div class="flex shrink-0 items-center gap-2">
|
2026-03-12 23:41:07 +00:00
|
|
|
{@render action?.()}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</PageBar>
|