import './ThemeColor.less'; import { CheckOutlined } from '@ant-design/icons'; import { Tooltip } from 'antd'; import React from 'react'; import { genThemeToString } from '../../utils/utils'; export type TagProps = { color: string; check: boolean; className?: string; onClick?: () => void; }; const Tag: React.FC = React.forwardRef(({ color, check, ...rest }, ref) => (
{check ? : ''}
)); export type ThemeColorProps = { colors?: { key: string; color: string; }[]; value: string; onChange: (color: string) => void; formatMessage: (data: { id: any; defaultMessage?: string }) => string; }; const ThemeColor: React.ForwardRefRenderFunction = ( { colors, value, onChange, formatMessage }, ref, ) => { const colorList = colors || []; if (colorList.length < 1) { return null; } return (
{colorList.map(({ key, color }) => { const themeKey = genThemeToString(color); return ( onChange && onChange(key)} /> ); })}
); }; export default React.forwardRef(ThemeColor);