ant-design / components /button /IconWrapper.tsx
AbdulElahGwaith's picture
Upload folder using huggingface_hub
5941ac2 verified
Raw
History Blame Contribute Delete
562 Bytes
import React, { forwardRef } from 'react';
import { clsx } from 'clsx';
export type IconWrapperProps = {
prefixCls: string;
className?: string;
style?: React.CSSProperties;
children?: React.ReactNode;
};
const IconWrapper = forwardRef<HTMLSpanElement, IconWrapperProps>((props, ref) => {
const { className, style, children, prefixCls } = props;
const iconWrapperCls = clsx(`${prefixCls}-icon`, className);
return (
<span ref={ref} className={iconWrapperCls} style={style}>
{children}
</span>
);
});
export default IconWrapper;