this is my custom button component, antd i want use all buttons with color and variant, but this is not working for color="primary" and variant="text". And i wonder why antd button ha no succcess, info, secondary buttons
import {Button as AntdButton, theme, ConfigProvider} from "antd";
import PropTypes from "prop-types";
export const Button = ({color, children, ...rest}) => {
const {token} = theme.useToken();
const colorMap = {
success: token.colorSuccess,
warning: token.colorWarning,
info: token.colorInfo,
error: token.colorError,
secondary: "#3577f1",
};
const colorPrimary = colorMap[color];
const button = <AntdButton color={color === 'error' ? "danger" : "primary"} {...rest}>{children}</AntdButton>;
return colorPrimary ? (
<ConfigProvider
theme={{
token: {
colorPrimary,
},
}}
>
{button}
</ConfigProvider>
) : (
button
);
};
Button.propTypes = {
color: PropTypes.string,
children: PropTypes.node,
};