UNPKG

@wq/material-web

Version:

Web bindings for @wq/material

19 lines (18 loc) 675 B
import React from "react"; import { BottomNavigationAction as MuiBottomNavigationAction } from "@mui/material"; import { Link } from "@wq/react"; import PropTypes from "prop-types"; import { useIcon } from "@wq/react"; export default function BottomNavigationAction({ icon, to, ...rest }) { const Icon = useIcon(icon); return /*#__PURE__*/ React.createElement(MuiBottomNavigationAction, { component: to && Link, icon: Icon && /*#__PURE__*/ React.createElement(Icon, null), to: to, ...rest, }); } BottomNavigationAction.propTypes = { icon: PropTypes.string, to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), };