@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
14 lines (13 loc) • 359 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useMemo } from 'react';
import { Icons } from './types';
const Icon = (props) => {
const { name, ...rest } = props;
const Icon = useMemo(() => {
return Icons[name];
}, [name]);
if (Icon === null)
return null;
return _jsx(Icon, { ...rest });
};
export default Icon;