2024-10-31 19:24:40 +00:00
|
|
|
<script lang="ts">
|
2026-02-03 17:49:44 +00:00
|
|
|
import type {Snippet} from "svelte"
|
2026-09-23 02:35:06 +00:00
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2025-02-11 23:37:50 +00:00
|
|
|
import NoteContent from "@app/components/NoteContent.svelte"
|
2024-10-31 19:24:40 +00:00
|
|
|
import NoteCard from "@app/components/NoteCard.svelte"
|
2026-09-23 02:35:06 +00:00
|
|
|
import EventReactions from "@app/components/EventReactions.svelte"
|
|
|
|
|
import Cv from "@lib/components/Cv.svelte"
|
2026-08-29 16:19:01 +00:00
|
|
|
import type {FeedContext} from "@app/feeds"
|
2024-10-31 19:24:40 +00:00
|
|
|
|
2026-02-03 17:49:44 +00:00
|
|
|
type Props = {
|
|
|
|
|
event: TrustedEvent
|
|
|
|
|
children?: Snippet
|
2026-08-29 16:19:01 +00:00
|
|
|
context: FeedContext
|
2026-02-13 21:05:17 +00:00
|
|
|
url?: string
|
2026-09-09 15:09:45 +00:00
|
|
|
card?: boolean
|
2026-09-23 02:35:06 +00:00
|
|
|
showEntire?: boolean
|
2026-02-03 17:49:44 +00:00
|
|
|
}
|
|
|
|
|
|
2026-09-23 03:48:41 +00:00
|
|
|
const {url, event, children, context, card = true, showEntire = false}: Props = $props()
|
2024-10-31 19:24:40 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-09-09 15:09:45 +00:00
|
|
|
{#snippet body()}
|
2026-09-23 02:35:06 +00:00
|
|
|
<NoteContent {event} {showEntire} expandMode="inline" />
|
2024-10-31 19:24:40 +00:00
|
|
|
<div class="flex w-full justify-between gap-2">
|
2026-09-23 02:35:06 +00:00
|
|
|
<EventReactions {event} {context} {url} reactionClass="tip-right" />
|
2026-02-03 17:49:44 +00:00
|
|
|
{@render children?.()}
|
2024-10-31 19:24:40 +00:00
|
|
|
</div>
|
2026-09-09 15:09:45 +00:00
|
|
|
{/snippet}
|
|
|
|
|
|
|
|
|
|
{#if card}
|
2026-09-23 03:48:41 +00:00
|
|
|
<Cv tag={NoteCard} {event} {url} interactive class="card card-interactive">
|
2026-09-09 15:09:45 +00:00
|
|
|
{@render body()}
|
|
|
|
|
</Cv>
|
|
|
|
|
{:else}
|
2026-09-23 03:48:41 +00:00
|
|
|
<NoteCard {event} {url}>
|
2026-09-09 15:09:45 +00:00
|
|
|
{@render body()}
|
|
|
|
|
</NoteCard>
|
|
|
|
|
{/if}
|