mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
24 lines
576 B
TypeScript
24 lines
576 B
TypeScript
|
import React, { forwardRef } from 'react';
|
||
|
import classNames from 'classnames';
|
||
|
|
||
|
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 = classNames(`${prefixCls}-icon`, className);
|
||
|
|
||
|
return (
|
||
|
<span ref={ref} className={iconWrapperCls} style={style}>
|
||
|
{children}
|
||
|
</span>
|
||
|
);
|
||
|
});
|
||
|
|
||
|
export default IconWrapper;
|