import { jsx as _jsx } from "react/jsx-runtime";
import { iconComponents, } from "../icon-components/index.js";
import { getDimensions } from "@powerhousedao/design-system";
import { Suspense, } from "react";
export function Icon({ name, size = 24, color, style, ...props }) {
    const dimensions = getDimensions(size);
    const _style = {
        color,
        ...dimensions,
        style,
    };
    const IconComponent = iconComponents[name];
    return (
    // displays div with the same size while icon
    // loads to avoid UI displacement
    _jsx(Suspense, { fallback: _jsx("div", { "data-testid": "icon-fallback", style: dimensions }), name: "icon-component", children: _jsx(IconComponent, { ...props, style: _style }) }));
}
//# sourceMappingURL=icon.js.map