| | |
| | | import { forwardRef } from 'react' |
| | | import { generate } from './utils' |
| | | import type { AbstractNode } from './utils' |
| | | |
| | |
| | | style?: React.CSSProperties |
| | | } |
| | | |
| | | const IconBase = ( |
| | | { |
| | | ref, |
| | | ...props |
| | | }: IconBaseProps & { |
| | | ref?: React.RefObject<React.MutableRefObject<HTMLOrSVGElement>>; |
| | | }, |
| | | ) => { |
| | | const IconBase = forwardRef<React.MutableRefObject<HTMLOrSVGElement>, IconBaseProps>((props, ref) => { |
| | | const { data, className, onClick, style, ...restProps } = props |
| | | |
| | | return generate(data.icon, `svg-${data.name}`, { |
| | |
| | | ...restProps, |
| | | 'ref': ref, |
| | | }) |
| | | } |
| | | |
| | | IconBase.displayName = 'IconBase' |
| | | }) |
| | | |
| | | export default IconBase |