flotilla/src/app/components/CalendarEventMeta.svelte
2026-07-29 15:52:13 -07:00

33 lines
995 B
Svelte

<script lang="ts">
import type {TrustedEvent} from "@welshman/util"
import {TimeEvent} from "@welshman/domain"
import UserCircle from "@assets/icons/user-circle.svg?dataurl"
import MapPoint from "@assets/icons/map-point.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
import {reader} from "@app/core"
import ProfileLink from "@app/components/ProfileLink.svelte"
type Props = {
event: TrustedEvent
url: string
}
const {event, url}: Props = $props()
const timeEvent = reader(TimeEvent)(event)
const location = timeEvent.location()
</script>
<div class="flex min-w-0 flex-col gap-1 text-sm opacity-75">
<span class="flex items-center gap-1">
<Icon icon={UserCircle} size={4} />
Posted by <ProfileLink pubkey={event.pubkey} {url} />
</span>
{#if location}
<span class="flex items-start gap-1">
<Icon icon={MapPoint} class="mt-[2px]" size={4} />
<span class="wrap-break-word">{location}</span>
</span>
{/if}
</div>