@wq/material-web
Version:
Web bindings for @wq/material
28 lines (27 loc) • 804 B
JavaScript
import React from "react";
import { Link, useIcon } from "@wq/react";
import { Button } from "@mui/material";
import PropTypes from "prop-types";
export default function HomeLink({ to, label, active, ...rest }) {
const HomeIcon = useIcon("home") || (() => "Home");
return /*#__PURE__*/ React.createElement(
Button,
{
component: Link,
to: to,
color: active ? "inherit" : "primary",
"aria-label": label,
...rest,
},
/*#__PURE__*/ React.createElement(HomeIcon, {
sx: {
verticalAlign: "middle",
},
})
);
}
HomeLink.propTypes = {
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
label: PropTypes.string,
active: PropTypes.bool,
};