import * as React from 'react'; import { TinyColor } from '@ctrl/tinycolor'; import { Drawer, Form, Input, Button, InputNumber, Checkbox, Space } from 'antd'; import { useIntl } from 'react-intl'; import { BugOutlined, EyeOutlined } from '@ant-design/icons'; import { DesignToken } from '../../../../../components/_util/theme'; import defaultTheme from '../../../../../components/_util/theme/default'; import Preview from './Preview'; export interface ThemeConfigProps { componentName: string; defaultToken: DesignToken; onChangeTheme: (theme: DesignToken) => void; } export default ({ onChangeTheme, defaultToken, componentName }: ThemeConfigProps) => { const { formatMessage } = useIntl(); const [visible, setVisible] = React.useState(false); const [previewVisible, setPreviewVisible] = React.useState(false); const [form] = Form.useForm(); const keys = Object.keys(defaultTheme); const onFinish = (nextToken: DesignToken) => { onChangeTheme(nextToken); }; return ( <>