Created the Button.jsx component

This commit is contained in:
Mathias Wagner 2023-04-18 18:58:04 +02:00
parent e452b07ba7
commit 5dff68998f
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -0,0 +1,8 @@
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faCircleNotch} from "@fortawesome/free-solid-svg-icons";
import "./styles.sass";
export const Button = ({type = "primary", text = "Button", onClick, loading = false}) => (
<button className={`btn btn-${type}`} onClick={loading ? undefined : onClick} disabled={loading}>{loading &&
<FontAwesomeIcon icon={faCircleNotch} spin={true}/>} {text}</button>
)