mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
18 lines
621 B
TypeScript
18 lines
621 B
TypeScript
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);
|