This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/dashboard-v2/src/components/IconButtonText/IconButtonText.js

47 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-02-18 08:20:47 +00:00
import PropTypes from "prop-types";
/**
* Primary UI component for user interaction
*/
export const IconButtonText = ({ primary, label, icon, ...props }) => {
return (
<button
type="button"
className={`flex justify-center items-center w-iconButtonTextWidth py-iconButtonTextY`}
{...props}
>
2022-02-18 08:20:47 +00:00
<div className={`h-buttonTextIcon w-buttonTextIcon ${primary ? "text-primary" : "text-palette-600"}`}>{icon}</div>
<p
2022-02-18 08:20:47 +00:00
className={"ml-iconButtonTextTextLeft tracking-wide text-iconButtonText font-sans font-light text-palette-600"}
>
{label}
</p>
</button>
2022-02-18 08:20:47 +00:00
);
};
IconButtonText.propTypes = {
/**
* Is this the principal call to action on the page?
*/
primary: PropTypes.bool,
/**
* Button Label
*/
label: PropTypes.string.isRequired,
/**
* Icon component
*/
icon: PropTypes.element.isRequired,
/**
* Optional click handler
*/
onClick: PropTypes.func,
2022-02-18 08:20:47 +00:00
};
IconButtonText.defaultProps = {
primary: false,
2022-02-18 08:20:47 +00:00
label: "",
onClick: undefined,
2022-02-18 08:20:47 +00:00
};