import React from "react"; import { ControlsProps } from "../../common/controls.type"; import classnames from "classnames"; import Spinner from "../spinner"; import Icon, { IconProp } from "../icon"; type ButtonType = | "default" | "primary" | "outline" | "plain" | "borderless" | "text"; export interface ButtonProps extends ControlsProps, Omit, "size"> { type?: ButtonType; htmlType?: "button" | "submit" | "reset"; loading?: boolean; children?: string | string[] | React.ReactElement; icon?: IconProp; suffixIcon?: IconProp; } const Button = ({ type = "default", size = "default", loading, disabled, success, error, warning, children, icon, suffixIcon, htmlType = "button", ...restProps }: ButtonProps) => { const status = error ? "error" : success ? "success" : warning ? "warning" : "default"; return ( ); }; export default Button;