mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-18 06:24:25 +01:00
refactor
This commit is contained in:
29
src/components/event/textNote/MentionedEventDisplay.tsx
Normal file
29
src/components/event/textNote/MentionedEventDisplay.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Show } from 'solid-js';
|
||||
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import EventDisplayById from '@/components/event/EventDisplayById';
|
||||
import EventLink from '@/components/EventLink';
|
||||
import { type MentionedEvent } from '@/nostr/parseTextNote';
|
||||
|
||||
export type MentionedEventDisplayProps = {
|
||||
mentionedEvent: MentionedEvent;
|
||||
};
|
||||
|
||||
const MentionedEventDisplay = (props: MentionedEventDisplayProps) => {
|
||||
return (
|
||||
<Show
|
||||
when={props.mentionedEvent.marker != null && props.mentionedEvent.marker.length > 0}
|
||||
fallback={<EventLink eventId={props.mentionedEvent.eventId} />}
|
||||
>
|
||||
<div class="my-1 rounded border p-1">
|
||||
<EventDisplayById
|
||||
eventId={props.mentionedEvent.eventId}
|
||||
embedding={false}
|
||||
actions={false}
|
||||
/>
|
||||
</div>
|
||||
</Show>
|
||||
);
|
||||
};
|
||||
|
||||
export default MentionedEventDisplay;
|
||||
Reference in New Issue
Block a user