'use client' import type { FC } from 'react' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor' import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import { Markdown } from '@/app/components/base/markdown' import LoadingAnim from '@/app/components/base/chat/chat/loading-anim' import StatusContainer from '@/app/components/workflow/run/status-container' type OutputPanelProps = { isRunning?: boolean outputs?: any error?: string height?: number } const OutputPanel: FC = ({ isRunning, outputs, error, height, }) => { return (
{isRunning && (
)} {!isRunning && error && (
{error}
)} {!isRunning && !outputs && (
)} {outputs && Object.keys(outputs).length === 1 && (
)} {outputs && Object.keys(outputs).length > 1 && height! > 0 && (
} language={CodeLanguage.json} value={outputs} isJSONStringifyBeauty height={height} />
)} ) } export default OutputPanel