diff --git a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx index 7f04989ef3..507c21472b 100644 --- a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx +++ b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx @@ -14,28 +14,6 @@ type Attachment = { mediaType: 'image/jpeg' | 'image/png' | 'image/gif' | 'video/mp4' | 'video/webm' | 'audio/mpeg' | 'audio/ogg' | null; }; -/* -type Post = { - id: URL; - url: URL; - - type: 'Note' | 'Article'; - - name: string; - content: string; - preview: { content: string } | null; - liked: boolean; - published: Date; - author: { - name: string; - username: string; - url: URL; - avatar: URL; - }; - attachment: null | Attachment | Attachment[]; -}; - */ - type AttachmentResult = null | Attachment | [Attachment, Attachment, ...Attachment[]] function toAttachment(value: unknown): Attachment | null { @@ -147,10 +125,10 @@ function FeedAttachment({object, layout}: {object: ObjectProperties, layout: 'mo } if (Array.isArray(attachment)) { - return + return ; } - return + return ; } function SingleInboxAttachment({attachment, object}: {attachment: Attachment, object: ObjectProperties}) { @@ -212,7 +190,7 @@ function InboxAttachment({object}: {object: ObjectProperties}) { ); } - return + return ; } function getTimestamp(published: Date) { @@ -368,14 +346,14 @@ function ItemHeading({children}: {children?: string }) { } return ( {children[0]} - ) + ); } function FeedLayoutArticleContent({object}: {object: ObjectProperties}) { - const content = object.preview ? object.preview.content :
+ const content = object.preview ? object.preview.content :
; return ( <> - + {object.name} @@ -399,17 +377,17 @@ function FeedLayoutNoteContent({object}: {object: ObjectProperties}) { {object.name}
- + ); } function FeedLayoutContent({object}: {object: ObjectProperties}) { if (object.type === 'Article') { - return + return ; } if (object.type === 'Note') { - return + return ; } } @@ -465,7 +443,7 @@ const FeedLayout = ({actor, object, type, comments = [], onClick = noop, onComme ); -} +}; const ModalLayout = ({actor, object, type, comments = [], onClick = noop, onCommentClick, author}: LayoutProps) => { const onLikeClick = () => {}; @@ -493,7 +471,7 @@ const ModalLayout = ({actor, object, type, comments = [], onClick = noop, onComm
{object.name && {object.name}}
- +
{object.name && {object.name}}
- +
); -} +}; const FeedItem: React.FC = ({actor, object, layout, type, comments = [], last, onClick = noop, onCommentClick = noop}) => { if (!object) { return null; } - let author = actor; if (type === 'Announce' && object.type === 'Note') { author = typeof object.attributedTo === 'object' ? object.attributedTo as ActorProperties : actor; @@ -613,45 +590,45 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment if (layout === 'feed') { return + actor={actor} + author={author} + comments={comments} + object={object} + type={type} + onClick={onClick} + onCommentClick={onCommentClick} + />; } else if (layout === 'modal') { return + actor={actor} + author={author} + comments={comments} + object={object} + type={type} + onClick={onClick} + onCommentClick={onCommentClick} + />; } else if (layout === 'reply') { return + actor={actor} + author={author} + comments={comments} + last={last} + object={object} + type={type} + onClick={onClick} + onCommentClick={onCommentClick} + />; } else if (layout === 'inbox') { return + actor={actor} + author={author} + comments={comments} + object={object} + type={type} + onClick={onClick} + onCommentClick={onCommentClick} + />; } return (<>);