'use client' import type { FC } from 'react' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { RiCloseLine } from '@remixicon/react' import { ArrowNarrowLeft } from '../../base/icons/src/vender/line/arrows' import NodePanel from './node' import cn from '@/utils/classnames' import type { NodeTracing } from '@/types/workflow' const i18nPrefix = 'workflow.singleRun' type Props = { list: NodeTracing[][] onHide: () => void onBack: () => void noWrap?: boolean } const IterationResultPanel: FC = ({ list, onHide, onBack, noWrap, }) => { const { t } = useTranslation() const main = ( <>
{t(`${i18nPrefix}.testRunIteration`)}
{t(`${i18nPrefix}.back`)}
{/* List */}
{list.map((iteration, index) => (
{t(`${i18nPrefix}.iteration`)} {index + 1}
{iteration.map(node => ( ))}
))}
) const handleNotBubble = useCallback((e: React.MouseEvent) => { // if not do this, it will trigger the message log modal disappear(useClickAway) e.stopPropagation() e.nativeEvent.stopImmediatePropagation() }, []) if (noWrap) return main return (
{main}
) } export default React.memo(IterationResultPanel)