@wq/material-web
Version:
Web bindings for @wq/material
16 lines (15 loc) • 485 B
JavaScript
import React from "react";
import { Button as MuiButton } from "@mui/material";
import { useIcon } from "@wq/react";
import PropTypes from "prop-types";
export default function Button({ icon, ...rest }) {
const Icon = useIcon(icon),
startIcon = Icon ? /*#__PURE__*/ React.createElement(Icon, null) : null;
return /*#__PURE__*/ React.createElement(MuiButton, {
startIcon: startIcon,
...rest,
});
}
Button.propTypes = {
icon: PropTypes.string,
};