2024-09-20 18:00:41 +00:00
|
|
|
<script lang="ts">
|
2025-02-06 17:53:50 +00:00
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2026-09-26 04:15:39 +00:00
|
|
|
import {getAddress} from "@welshman/util"
|
|
|
|
|
import {TimeEvent} from "@welshman/domain"
|
2025-02-06 17:29:30 +00:00
|
|
|
import Link from "@lib/components/Link.svelte"
|
2026-09-09 20:53:25 +00:00
|
|
|
import Cv from "@lib/components/Cv.svelte"
|
2026-09-25 23:24:51 +00:00
|
|
|
import ContentActions from "@app/components/ContentActions.svelte"
|
|
|
|
|
import CalendarEventEdit from "@app/components/CalendarEventEdit.svelte"
|
2026-09-26 04:15:39 +00:00
|
|
|
import {reader} from "@app/core"
|
2026-08-29 16:19:01 +00:00
|
|
|
import type {FeedContext} from "@app/feeds"
|
2025-02-12 00:00:14 +00:00
|
|
|
import CalendarEventHeader from "@app/components/CalendarEventHeader.svelte"
|
2025-02-06 19:12:15 +00:00
|
|
|
import ProfileLink from "@app/components/ProfileLink.svelte"
|
2025-10-30 22:36:14 +00:00
|
|
|
import RoomLink from "@app/components/RoomLink.svelte"
|
2026-09-03 20:13:21 +00:00
|
|
|
import UnreadDot from "@app/components/UnreadDot.svelte"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {makeCalendarPath} from "@app/routes"
|
2024-09-20 18:00:41 +00:00
|
|
|
|
2025-02-12 00:00:14 +00:00
|
|
|
type Props = {
|
2025-02-06 17:53:50 +00:00
|
|
|
url: string
|
|
|
|
|
event: TrustedEvent
|
2026-08-29 16:19:01 +00:00
|
|
|
context: FeedContext
|
2025-02-12 00:00:14 +00:00
|
|
|
}
|
2024-09-20 18:00:41 +00:00
|
|
|
|
2026-08-29 16:19:01 +00:00
|
|
|
const {url, event, context}: Props = $props()
|
2025-10-06 18:23:19 +00:00
|
|
|
|
2026-09-03 20:13:21 +00:00
|
|
|
const path = $derived(makeCalendarPath(url, getAddress(event)))
|
2026-09-26 04:15:39 +00:00
|
|
|
const h = $derived(reader(TimeEvent)(event).room())
|
2024-09-20 18:00:41 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-09-09 20:53:25 +00:00
|
|
|
<Cv tag={Link} class="relative flex flex-col gap-3 card card-interactive w-full" href={path}>
|
2026-09-03 20:13:21 +00:00
|
|
|
<UnreadDot {path} class="absolute right-3 top-3" />
|
2025-03-17 16:53:14 +00:00
|
|
|
<CalendarEventHeader {event} />
|
2025-02-05 21:02:51 +00:00
|
|
|
<div class="flex w-full flex-col items-end justify-between gap-2 sm:flex-row">
|
2025-02-06 19:12:15 +00:00
|
|
|
<span class="whitespace-nowrap py-1 text-sm opacity-75">
|
2025-04-15 18:03:27 +00:00
|
|
|
Posted by <ProfileLink pubkey={event.pubkey} {url} />
|
2025-10-30 22:33:34 +00:00
|
|
|
{#if h}
|
2025-10-30 22:36:14 +00:00
|
|
|
in <RoomLink {url} {h} />
|
2025-10-06 18:23:19 +00:00
|
|
|
{/if}
|
2025-02-06 19:12:15 +00:00
|
|
|
</span>
|
2026-09-25 23:24:51 +00:00
|
|
|
<ContentActions
|
|
|
|
|
showActivity
|
|
|
|
|
noun="Event"
|
|
|
|
|
editForm={CalendarEventEdit}
|
|
|
|
|
{url}
|
|
|
|
|
{event}
|
|
|
|
|
{context} />
|
2024-09-20 18:00:41 +00:00
|
|
|
</div>
|
2026-09-09 20:53:25 +00:00
|
|
|
</Cv>
|