UNPKG

875 BJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/esm/extends";
2import * as React from 'react';
3import SvgIcon from '../SvgIcon';
4/**
5 * Private module reserved for @mui packages.
6 */
7
8import { jsx as _jsx } from "react/jsx-runtime";
9export default function createSvgIcon(path, displayName) {
10 var Component = function Component(props, ref) {
11 return /*#__PURE__*/_jsx(SvgIcon, _extends({
12 "data-testid": "".concat(displayName, "Icon"),
13 ref: ref
14 }, props, {
15 children: path
16 }));
17 };
18
19 if (process.env.NODE_ENV !== 'production') {
20 // Need to set `displayName` on the inner component for React.memo.
21 // React prior to 16.14 ignores `displayName` on the wrapper.
22 Component.displayName = "".concat(displayName, "Icon");
23 }
24
25 Component.muiName = SvgIcon.muiName;
26 return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
27}
\No newline at end of file