diff --git a/web/src/components/home-card.tsx b/web/src/components/home-card.tsx index 12bb6427e1..fa72fb9342 100644 --- a/web/src/components/home-card.tsx +++ b/web/src/components/home-card.tsx @@ -1,7 +1,12 @@ import { RAGFlowAvatar } from '@/components/ragflow-avatar'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from '@/components/ui/tooltip'; import { formatDate } from '@/utils/date'; -import { ReactNode } from 'react'; +import { ElementType, ReactNode, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; interface IProps { @@ -24,6 +29,49 @@ interface IProps { function Time({ time }: { time: string | number | undefined }) { return
{formatDate(time)}
; } + +function TruncatedText({ + as: Tag = 'div', + className, + children, + tooltip, + testId, +}: { + as?: ElementType; + className?: string; + children?: ReactNode; + tooltip?: ReactNode; + testId?: string; +}) { + const ref = useRef