import { memo, useEffect, useState } from 'react' import { usePath } from '@/hooks/usePath' import { getFileInfo } from '@/utils/file' import Icon from '../FileUploadPreview/Icon' const DocMessage = ({ id }: { id: string }) => { const { onViewFile } = usePath() const [fileInfo, setFileInfo] = useState< { filename: string; id: string } | undefined >() useEffect(() => { if (!fileInfo) { getFileInfo(id).then((data) => { setFileInfo(data) }) } }, [fileInfo, id]) return (
{fileInfo?.id ?? id}