Break out a few shared sub-components

This commit is contained in:
Jon Staab
2025-02-06 09:39:23 -08:00
parent 5684d1a9cf
commit d66371d573
6 changed files with 49 additions and 47 deletions
+19
View File
@@ -0,0 +1,19 @@
<script lang="ts">
import type {TrustedEvent} from "@welshman/util"
import {preventDefault} from "@lib/html"
import Button from "@lib/components/Button.svelte"
import ProfileName from "@app/components/ProfileName.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import {pushModal} from "@app/modal"
const {event}: {event: TrustedEvent} = $props()
const openProfile = () => pushModal(ProfileDetail, {pubkey: event.pubkey})
</script>
<span class="whitespace-nowrap py-1 text-sm opacity-75">
Posted by
<Button onclick={preventDefault(openProfile)} class="link-content">
@<ProfileName pubkey={event.pubkey} />
</Button>
</span>