"use client"; import { cn } from "@/lib/utils"; import { FC, HTMLAttributes } from "react"; import Tooltip from "./Tooltip"; interface EllipsisProps extends HTMLAttributes { children: string; maxCharacters: number; tooltip?: boolean; } const Ellipsis: FC = ({ children: originalContent, className, maxCharacters, tooltip = false, }) => { const renderedContent = originalContent.length > maxCharacters ? `${originalContent.slice(0, maxCharacters)}...` : originalContent; console.log(originalContent, maxCharacters, tooltip, renderedContent); if (tooltip && originalContent !== renderedContent) { return ( {renderedContent} ); } return ( {renderedContent} ); }; export default Ellipsis;