2026-03-09 17:01:35 +08:00
|
|
|
import type { Comment } from '@bitsocialnet/bitsocial-react-hooks';
|
2026-03-13 13:25:10 +08:00
|
|
|
import { getCommentCommunityAddress } from './comment-utils';
|
2025-12-05 17:38:17 +01:00
|
|
|
|
|
|
|
|
export type PostMenuProps = {
|
|
|
|
|
cid?: string;
|
|
|
|
|
postCid?: string;
|
|
|
|
|
parentCid?: string;
|
2026-03-13 13:25:10 +08:00
|
|
|
communityAddress?: string;
|
2025-12-05 17:38:17 +01:00
|
|
|
authorAddress?: string;
|
|
|
|
|
link?: string;
|
|
|
|
|
linkWidth?: number;
|
|
|
|
|
linkHeight?: number;
|
|
|
|
|
thumbnailUrl?: string;
|
|
|
|
|
deleted?: boolean;
|
|
|
|
|
removed?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-13 13:25:10 +08:00
|
|
|
export const selectPostMenuProps = (post?: Comment): PostMenuProps => {
|
|
|
|
|
const communityAddress = getCommentCommunityAddress(post);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
cid: post?.cid,
|
|
|
|
|
postCid: post?.postCid,
|
|
|
|
|
parentCid: post?.parentCid,
|
|
|
|
|
communityAddress,
|
|
|
|
|
authorAddress: post?.author?.address,
|
|
|
|
|
link: post?.link,
|
|
|
|
|
linkWidth: post?.linkWidth,
|
|
|
|
|
linkHeight: post?.linkHeight,
|
|
|
|
|
thumbnailUrl: post?.thumbnailUrl,
|
|
|
|
|
deleted: post?.deleted,
|
|
|
|
|
removed: post?.removed,
|
|
|
|
|
};
|
|
|
|
|
};
|