@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
33 lines (32 loc) • 1.03 kB
JavaScript
"use client";
import React, { useContext } from 'react';
import clsx from 'clsx';
import FlexItem from "../flex/Item.js";
import Icon from "../icon/Icon.js";
import { ListContext } from "./ListContext.js";
import { createSkeletonClass } from "../skeleton/SkeletonHelper.js";
import { jsx as _jsx } from "react/jsx-runtime";
function ItemIcon({
children,
className,
skeleton,
...rest
}) {
var _useContext;
const inheritedSkeleton = (_useContext = useContext(ListContext)) === null || _useContext === void 0 ? void 0 : _useContext.skeleton;
const appliedSkeleton = skeleton !== null && skeleton !== void 0 ? skeleton : inheritedSkeleton;
return _jsx(FlexItem, {
className: clsx('dnb-list__item__icon', className, appliedSkeleton && createSkeletonClass('font', true)),
innerSpace: {
left: 'small'
},
...rest,
children: _jsx(Icon, {
size: "medium",
children: children
})
});
}
ItemIcon._supportsSpacingProps = true;
export default ItemIcon;
//# sourceMappingURL=ItemIcon.js.map