import React from 'react' import { useTree, usePrefix } from '../../hooks' import { observer } from '@formily/reactive-react' import { IconWidget } from '../IconWidget' import './styles.less' export interface IEmptyWidgetProps { dragTipsDirection?: 'left' | 'right' } export const EmptyWidget: React.FC = observer((props) => { const tree = useTree() const prefix = usePrefix('empty') const renderEmpty = () => { return (
Selection + Click /{' '} + Click /{' '} + A
Copy + C / Paste{' '} + V
Delete
) } if (!tree?.children?.length) { return (
{props.children ? props.children : renderEmpty()}
) } return null }) EmptyWidget.defaultProps = { dragTipsDirection: 'left', }