@wq/material-web
Version:
Web bindings for @wq/material
23 lines (21 loc) • 703 B
JavaScript
import React from "react";
import { Tab as MuiTab } from "@mui/material";
import { Link } from "@wq/react";
import PropTypes from "prop-types";
import { useIcon } from "@wq/react";
export default function TabItem({ icon, to, children, ...rest }) {
/* eslint no-unused-vars: off */
const Icon = useIcon(icon);
return /*#__PURE__*/ React.createElement(MuiTab, {
component: to && Link,
icon: Icon && /*#__PURE__*/ React.createElement(Icon, null),
to: to,
...rest,
});
// children rendered by TabGroup
}
TabItem.propTypes = {
icon: PropTypes.string,
to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
children: PropTypes.node,
};