'use client' import type { FC } from 'react' import { useTranslation } from 'react-i18next' import StatusPanel from './status' import MetaData from './meta' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor' import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' type ResultPanelProps = { inputs?: string process_data?: string outputs?: string status: string error?: string elapsed_time?: number total_tokens?: number created_at?: number created_by?: string finished_at?: number steps?: number showSteps?: boolean } const ResultPanel: FC = ({ inputs, process_data, outputs, status, error, elapsed_time, total_tokens, created_at, created_by, steps, showSteps, }) => { const { t } = useTranslation() return (
{t('workflow.common.input').toLocaleUpperCase()}
} language={CodeLanguage.json} value={inputs} isJSONStringifyBeauty /> {process_data && ( {t('workflow.common.processData').toLocaleUpperCase()}
} language={CodeLanguage.json} value={process_data} isJSONStringifyBeauty /> )} {(outputs || status === 'running') && ( {t('workflow.common.output').toLocaleUpperCase()}} language={CodeLanguage.json} value={outputs} isJSONStringifyBeauty /> )}
) } export default ResultPanel