import React from 'react'; import useLocale from '../../hooks/useLocale'; import SemanticPreview from './SemanticPreview'; export const locales = { cn: { root: '根元素', 'popup.root': '弹出菜单元素', }, en: { root: 'Root element', 'popup.root': 'Popup element', }, }; interface BlockProps { component: React.ComponentType; options?: { value: string; label: string }[]; defaultValue?: string; style?: React.CSSProperties; [key: string]: any; } const Block: React.FC = ({ component: Component, options, defaultValue, ...props }) => { const divRef = React.useRef(null); return (
divRef.current} options={options} styles={{ popup: { zIndex: 1 }, }} />
); }; export interface SelectSemanticTemplateProps { component: React.ComponentType; componentName: string; defaultValue?: string; options?: { value: string; label: string }[]; height?: number; onSearch?: (text: string) => void; placeholder?: string; style?: React.CSSProperties; [key: string]: any; } const SelectSemanticTemplate: React.FC = ({ component, defaultValue, options, height, style, componentName, ...restProps }) => { const [locale] = useLocale(locales); return ( ); }; export default SelectSemanticTemplate;