import type { FC } from 'react' import { useTranslation } from 'react-i18next' import { useEffect, useRef, useState } from 'react' import { useClickAway } from 'ahooks' import { RiCloseLine } from '@remixicon/react' import cn from '@/utils/classnames' import type { IChatItem } from '@/app/components/base/chat/chat/type' import Run from '@/app/components/workflow/run' type MessageLogModalProps = { currentLogItem?: IChatItem defaultTab?: string width: number fixedWidth?: boolean onCancel: () => void } const MessageLogModal: FC = ({ currentLogItem, defaultTab = 'DETAIL', width, fixedWidth, onCancel, }) => { const { t } = useTranslation() const ref = useRef(null) const [mounted, setMounted] = useState(false) useClickAway(() => { if (mounted) onCancel() }, ref) useEffect(() => { setMounted(true) }, []) if (!currentLogItem || !currentLogItem.workflow_run_id) return null return (

{t('appLog.runDetail.title')}

) } export default MessageLogModal