@wq/material-web
Version:
Web bindings for @wq/material
29 lines (28 loc) • 787 B
JavaScript
import React from "react";
import { Fab as MuiFab } from "@mui/material";
import { Link } from "@wq/react";
import PropTypes from "prop-types";
import { useIcon } from "@wq/react";
export default function Fab({ icon, to, ...rest }) {
const Icon = useIcon(icon);
return /*#__PURE__*/ React.createElement(
MuiFab,
{
component: Link,
to: to,
color: "primary",
style: {
position: "absolute",
right: 16,
bottom: 16,
zIndex: 5000,
},
...rest,
},
/*#__PURE__*/ React.createElement(Icon, null)
);
}
Fab.propTypes = {
icon: PropTypes.string,
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
};