2024-04-08 18:51:46 +08:00
|
|
|
import { memo } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-04-28 17:09:56 +08:00
|
|
|
import { useIsChatMode } from '../hooks'
|
|
|
|
import { useStore } from '../store'
|
2025-06-19 17:53:49 +08:00
|
|
|
import { formatWorkflowRunIdentifier } from '../utils'
|
2024-04-28 17:09:56 +08:00
|
|
|
import { ClockPlay } from '@/app/components/base/icons/src/vender/line/time'
|
2024-04-08 18:51:46 +08:00
|
|
|
|
|
|
|
const RunningTitle = () => {
|
|
|
|
const { t } = useTranslation()
|
2024-04-28 17:09:56 +08:00
|
|
|
const isChatMode = useIsChatMode()
|
|
|
|
const historyWorkflowData = useStore(s => s.historyWorkflowData)
|
2024-04-08 18:51:46 +08:00
|
|
|
|
|
|
|
return (
|
2025-03-21 17:41:03 +08:00
|
|
|
<div className='flex h-[18px] items-center text-xs text-gray-500'>
|
|
|
|
<ClockPlay className='mr-1 h-3 w-3 text-gray-500' />
|
2025-06-19 17:53:49 +08:00
|
|
|
<span>{isChatMode ? `Test Chat${formatWorkflowRunIdentifier(historyWorkflowData?.finished_at)}` : `Test Run${formatWorkflowRunIdentifier(historyWorkflowData?.finished_at)}`}</span>
|
2024-04-08 18:51:46 +08:00
|
|
|
<span className='mx-1'>·</span>
|
2025-03-21 17:41:03 +08:00
|
|
|
<span className='ml-1 flex h-[18px] items-center rounded-[5px] border border-indigo-300 bg-white/[0.48] px-1 text-[10px] font-semibold uppercase text-indigo-600'>
|
2024-04-28 17:09:56 +08:00
|
|
|
{t('workflow.common.viewOnly')}
|
|
|
|
</span>
|
2024-04-08 18:51:46 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(RunningTitle)
|