"use client"; import { Separator } from "./Layout"; import { CommentTiny } from "./Icons/CommentTiny"; import { QuoteTiny } from "./Icons/QuoteTiny"; import { useSmoker } from "./Toast"; import { Tag } from "./Tags"; import { Popover } from "./Popover"; import { TagTiny } from "./Icons/TagTiny"; import { SpeedyLink } from "./SpeedyLink"; import { RecommendButton } from "./RecommendButton"; export const InteractionPreview = (props: { quotesCount: number; commentsCount: number; recommendsCount: number; documentUri: string; tags?: string[]; postUrl: string; showComments: boolean; showMentions: boolean; showRecommends: boolean; share?: boolean; }) => { let smoker = useSmoker(); let interactionsAvailable = (props.quotesCount > 0 && props.showMentions) || (props.showComments !== false && props.commentsCount > 0) || (props.showRecommends !== false && props.recommendsCount > 0); const tagsCount = props.tags?.length || 0; return (
{props.showRecommends === false ? null : ( )} {!props.showMentions || props.quotesCount === 0 ? null : ( {props.quotesCount} )} {!props.showComments || props.commentsCount === 0 ? null : ( {props.commentsCount} )} {tagsCount === 0 ? null : ( <> {interactionsAvailable ? : null} )} {props.share && ( <> )}
); }; export const TagPopover = (props: { tags: string[] }) => { return ( {props.tags.length} } > ); }; const TagList = (props: { tags: string[]; className?: string }) => { return (
{props.tags.map((tag, index) => ( ))}
); };