import { Button, ColorPicker, ConfigProvider, Form, InputNumber } from 'antd'; import type { Color } from 'antd/es/color-picker'; import React from 'react'; type ThemeData = { borderRadius: number; colorPrimary: string; }; const defaultData: ThemeData = { borderRadius: 6, colorPrimary: '#1677ff', }; export default () => { const [form] = Form.useForm(); const [data, setData] = React.useState(defaultData); return (
{ const colorObj = changedValues?.colorPrimary ? { colorPrimary: (allValues?.colorPrimary as Color)?.toHexString() } : {}; setData({ ...allValues, ...colorObj, }); }} name="theme" initialValues={defaultData} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} >
); };