import React from 'react'; import { CloseOutlined } from '@ant-design/icons'; import { css, cx } from '@nocobase/client'; import { AddButton } from './AddButton'; import { useGetAriaLabelOfAddButton } from './hooks/useGetAriaLabelOfAddButton'; import { Node } from './nodes'; import useStyles from './style'; export function Branch({ from = null, entry = null, branchIndex = null, controller = null, className, end, }: { from?: any; entry?: any; branchIndex?: number | null; controller?: React.ReactNode; className?: string; end?: boolean; }) { const { styles } = useStyles(); const { getAriaLabel } = useGetAriaLabelOfAddButton(from, branchIndex); const list: any[] = []; for (let node = entry; node; node = node.downstream) { list.push(node); } return (
{controller}
{list.map((item) => ( ))}
{end ? (
) : null}
); }