22 lines
548 B
JavaScript
22 lines
548 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
export const Refresh = ({ onClick, loading, kind }) => {
|
|
return (
|
|
<button onClick={onClick} className={`btn btn-${kind} btn-sm w-md-100 m-1`}>
|
|
<i className={`fa ${loading ? "fa-spin" : ""} fa-refresh mr-1`} />
|
|
Refresh
|
|
</button>
|
|
);
|
|
};
|
|
Refresh.propTypes = {
|
|
onClick: PropTypes.func.isRequired,
|
|
loading: PropTypes.bool.isRequired,
|
|
kind: PropTypes.string.isRequired,
|
|
};
|
|
Refresh.defaultProps = {
|
|
onClick: () => {},
|
|
loading: false,
|
|
kind: "secondary",
|
|
};
|