@blocklet/ui-react
Version:
Some useful front-end web components that can be used in Blocklets.
32 lines (31 loc) • 795 B
JavaScript
import { jsxs as i, jsx as s } from "react/jsx-runtime";
import { styled as d, Menu as n, MenuItem as l, ListItemIcon as p } from "@mui/material";
import a from "react";
function c({
icon: e = void 0,
selected: t = void 0,
onClick: o,
children: r
}) {
return /* @__PURE__ */ i(l, { onClick: o, className: t ? "selected" : "", children: [
e && /* @__PURE__ */ s(p, { style: { minWidth: "24px" }, children: a.createElement(e, {
style: { fontSize: "16px", width: "16px", height: "16px" }
}) }),
r
] });
}
const h = d(n)`
.MuiPaper-root {
box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.15);
}
.MuiList-root {
min-width: 160px;
}
.selected {
background-color: ${({ theme: e }) => e.palette.grey[50]};
}
`;
export {
h as StyledMenu,
c as default
};