'use client'; import { cn } from '@/utils/cn'; import { Asterisk, ChevronRight } from 'lucide-react'; import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip'; interface RenderDotsProps extends React.HTMLAttributes { children: string; truncate?: boolean; } export function RenderDots({ children, className, truncate, ...props }: RenderDotsProps) { const parts = children.split('.'); const sliceAt = truncate && parts.length > 3 ? 3 : 0; return (
{parts.slice(-sliceAt).map((str, index) => { return (
{index !== 0 && ( )} {str.includes('[*]') ? ( <> {str.replace('[*]', '')} ) : str === '*' ? ( ) : ( str )}
); })}

{children}

); }