2026-04-03 17:54:50 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {tagSpec, tagValue} from "@welshman/util"
|
2026-04-03 17:54:50 +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-04-03 17:54:50 +00:00
|
|
|
import NoteContent from "@app/components/NoteContent.svelte"
|
2026-09-25 23:24:51 +00:00
|
|
|
import ContentActions from "@app/components/ContentActions.svelte"
|
2026-08-29 16:19:01 +00:00
|
|
|
import type {FeedContext} from "@app/feeds"
|
2026-04-03 17:54:50 +00:00
|
|
|
import RoomLink from "@app/components/RoomLink.svelte"
|
|
|
|
|
import ProfileLink from "@app/components/ProfileLink.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 {makePollPath} from "@app/routes"
|
2026-04-03 17:54:50 +00:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
url: string
|
|
|
|
|
event: TrustedEvent
|
2026-08-29 16:19:01 +00:00
|
|
|
context: FeedContext
|
2026-04-03 17:54:50 +00:00
|
|
|
}
|
|
|
|
|
|
2026-08-29 16:19:01 +00:00
|
|
|
const {url, event, context}: Props = $props()
|
2026-04-03 17:54:50 +00:00
|
|
|
|
2026-09-03 20:13:21 +00:00
|
|
|
const path = makePollPath(url, event.id)
|
2026-07-28 16:16:26 +00:00
|
|
|
const h = tagValue(tagSpec("h"), event.tags)
|
2026-04-03 17:54:50 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-09-09 20:53:25 +00:00
|
|
|
<Cv tag={Link} class="relative flex flex-col gap-2 card card-interactive w-full" href={path}>
|
2026-09-03 20:13:21 +00:00
|
|
|
<UnreadDot {path} class="absolute right-3 top-3" />
|
2026-04-03 17:54:50 +00:00
|
|
|
<NoteContent {event} {url} />
|
|
|
|
|
<div class="flex w-full flex-col items-end justify-between gap-2 sm:flex-row">
|
|
|
|
|
<span class="whitespace-nowrap py-1 text-sm opacity-75">
|
|
|
|
|
Posted by <ProfileLink pubkey={event.pubkey} {url} />
|
|
|
|
|
{#if h}
|
|
|
|
|
in <RoomLink {url} {h} />
|
|
|
|
|
{/if}
|
|
|
|
|
</span>
|
2026-09-25 23:24:51 +00:00
|
|
|
<ContentActions showActivity noun="Poll" {url} {event} {context} />
|
2026-04-03 17:54:50 +00:00
|
|
|
</div>
|
2026-09-09 20:53:25 +00:00
|
|
|
</Cv>
|