chore: image custom params

This commit is contained in:
jialin
2024-11-27 17:07:22 +08:00
parent ba76498acc
commit 230120fff5
19 changed files with 473 additions and 206 deletions
@@ -0,0 +1,19 @@
import { ParamsSchema } from '@/pages/playground/config/types';
import { useIntl } from '@umijs/max';
import React from 'react';
import componentsMap from './config/components';
const FieldComponent: React.FC<ParamsSchema> = (props) => {
const intl = useIntl();
const { type, label, attrs, style, ...rest } = props;
return React.createElement(componentsMap[type], {
...rest,
...attrs,
style: { ...style, width: '100%' },
label: label.isLocalized
? intl.formatMessage({ id: label.text })
: label.text
});
};
export default React.memo(FieldComponent);