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