MuiIcon.jsx 325 Bytes
Newer Older
Muhammadali's avatar
Muhammadali committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/** @format */

import React, { createElement } from 'react';
import * as MuiIcons from '@mui/icons-material';

export const MuiIcon = ({ iconName }) => {
	try {
		return <>{createElement(MuiIcons[iconName])}</>;
	} catch {
		return <>{createElement(MuiIcons['BubbleChart'])}</>;
	}
};

export default MuiIcon;