2024-10-23 23:16:28 +00:00
|
|
|
<script lang="ts">
|
2026-07-28 16:16:26 +00:00
|
|
|
import {tagSpec, tagValue} from "@welshman/util"
|
2025-05-12 22:10:24 +00:00
|
|
|
import type {TrustedEvent, EventContent} from "@welshman/util"
|
2025-10-06 18:23:19 +00:00
|
|
|
import Link from "@lib/components/Link.svelte"
|
2025-10-30 22:36:14 +00:00
|
|
|
import RoomName from "@app/components/RoomName.svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {publishReaction, retractReaction} from "@app/reactions"
|
2024-10-24 16:45:27 +00:00
|
|
|
import ReactionSummary from "@app/components/ReactionSummary.svelte"
|
2025-02-06 17:39:23 +00:00
|
|
|
import ThunkStatusOrDeleted from "@app/components/ThunkStatusOrDeleted.svelte"
|
2025-02-06 17:53:50 +00:00
|
|
|
import EventActivity from "@app/components/EventActivity.svelte"
|
2025-02-06 18:00:25 +00:00
|
|
|
import EventActions from "@app/components/EventActions.svelte"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {makeThreadPath, makeSpacePath} from "@app/routes"
|
2024-10-23 23:16:28 +00:00
|
|
|
|
2025-02-04 00:37:14 +00:00
|
|
|
interface Props {
|
2025-10-06 18:23:19 +00:00
|
|
|
url: string
|
|
|
|
|
event: TrustedEvent
|
|
|
|
|
showRoom?: boolean
|
2025-02-04 00:37:14 +00:00
|
|
|
showActivity?: boolean
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-06 18:23:19 +00:00
|
|
|
const {url, event, showRoom, showActivity}: Props = $props()
|
2025-08-19 21:03:04 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const h = tagValue(tagSpec("h"), event.tags)
|
2025-02-06 17:29:30 +00:00
|
|
|
const path = makeThreadPath(url, event.id)
|
2026-07-28 16:16:26 +00:00
|
|
|
const deleteReaction = (reaction: TrustedEvent) => retractReaction(reaction, {url})
|
2024-10-23 23:16:28 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const createReaction = (values: EventContent) => publishReaction(event, values, {url})
|
2024-10-23 23:16:28 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-04-07 21:53:19 +00:00
|
|
|
<div class="flex grow flex-wrap justify-end gap-2">
|
2025-10-30 22:33:34 +00:00
|
|
|
{#if h && showRoom}
|
2026-06-24 20:56:53 +00:00
|
|
|
<Link href={makeSpacePath(url, h)} class="button button-neutral button-xs rounded-full">
|
2025-10-30 22:36:14 +00:00
|
|
|
Posted in #<RoomName {h} {url} />
|
2025-10-06 18:23:19 +00:00
|
|
|
</Link>
|
|
|
|
|
{/if}
|
2026-08-21 15:31:53 +00:00
|
|
|
<ThunkStatusOrDeleted {event}>
|
|
|
|
|
<ReactionSummary {url} {event} {deleteReaction} {createReaction} reactionClass="tip-left" />
|
|
|
|
|
{#if showActivity}
|
|
|
|
|
<EventActivity {url} {path} {event} />
|
|
|
|
|
{/if}
|
|
|
|
|
<EventActions {url} {event} noun="Thread" />
|
|
|
|
|
</ThunkStatusOrDeleted>
|
2024-10-23 23:16:28 +00:00
|
|
|
</div>
|