mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 19:19:26 +08:00
41ed9bd430
* feat: add semantic doc * 🔀 feat: rebase feature * feat: update for code reviewer * feat: update snap * feat: update snap * 🐛 bug: update for cov * Message * bug: update snap * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * ♻️ feat: ref code * 🩺 feat: update for review * 💄 style: update style * 📝 doc: update doc * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 💄 style: update style * 📸 feat:update snap * 🚧 feat: clean up * 🚧 feat: clean up * feat: icon wrapper * test: update snapshot * chore: code clean * fix: icon only font size * chore: rollback unexpected commit --------- Co-authored-by: MadCcc <1075746765@qq.com>
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;
|