import * as React from "react"; export type ButtonType = "primary" | "danger" | null; export default function Btn(props: { onClick?: () => void; icon?: JSX.Element; type?: ButtonType; text?: React.ReactNode; bordered?: boolean; shadow?: boolean; className?: string; title?: string; disabled?: boolean; tabIndex?: number; autoFocus?: boolean; }) { const { onClick, icon, type, text, className, title, disabled, tabIndex, autoFocus, } = props; let btnClassName; switch (type) { case "primary": btnClassName = `${disabled ? "bg-blue-300" : "bg-blue-600"} text-white`; break; case "danger": btnClassName = `${ disabled ? "bg-blue-300" : "bg-blue-600" } text-text-danger`; break; default: btnClassName = `${ disabled ? "bg-gray-100" : "bg-gray-300" } text-gray-500`; } return ( ); }