mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(markdown): handle unavailable reply quote links
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
|
||||
export const formatQuoteNumber = (number?: number) => `>>${number ?? '?'}`;
|
||||
|
||||
export const isUnavailableQuoteTarget = (comment?: Partial<Pick<Comment, 'deleted' | 'removed'>> | null) => Boolean(comment?.deleted || comment?.removed);
|
||||
|
||||
export const shouldShowFloatingQuotePreview = ({
|
||||
hoveredCid,
|
||||
outOfViewCid,
|
||||
quoteCid,
|
||||
isUnavailable,
|
||||
}: {
|
||||
hoveredCid: string | null;
|
||||
outOfViewCid: string | null;
|
||||
quoteCid?: string;
|
||||
isUnavailable?: boolean;
|
||||
}) => Boolean(quoteCid && !isUnavailable && hoveredCid === quoteCid && outOfViewCid === quoteCid);
|
||||
Reference in New Issue
Block a user