import React, { FunctionComponent } from 'react';
import { TreeSelect as AntdTreeSelect } from 'antd';
import { IReactOptionsComponent } from '@wowpic/xform-types';
const renderTreeNode = (options: any, path: string = '') => options.map((option: any) => {
const title = option.label || option.name;
return (
{option.children
? renderTreeNode(option.children, title)
: null}
);
});
const TreeSelect: FunctionComponent = ({
value,
options,
onChange,
...props
}) => (
{renderTreeNode(options)}
);
export default TreeSelect;