UNPKG

791 BJavaScriptView Raw
1'use client';
2
3import * as React from 'react';
4import SvgIcon from "../SvgIcon/index.js";
5
6/**
7 * Private module reserved for @mui packages.
8 */
9import { jsx as _jsx } from "react/jsx-runtime";
10export default function createSvgIcon(path, displayName) {
11 function Component(props, ref) {
12 return /*#__PURE__*/_jsx(SvgIcon, {
13 "data-testid": `${displayName}Icon`,
14 ref: ref,
15 ...props,
16 children: path
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 = `${displayName}Icon`;
23 }
24 Component.muiName = SvgIcon.muiName;
25 return /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(Component));
26}
\No newline at end of file