mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
* refactor: uninstall classnames & install clsx * refactor: uninstall classnames & install clsx * test: rename test fn * test: update snap * update * update * update * update * update snap * update * update --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: thinkasany <480968828@qq.com>
24 lines
562 B
TypeScript
24 lines
562 B
TypeScript
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;
|