import type { FC, ReactNode } from 'react' import classNames from 'classnames' import { Children, cloneElement, isValidElement } from 'react' export interface IconListProps { children: ReactNode iconWidth: number iconHeight: number } export const IconList: FC = ({ children, iconWidth, iconHeight }) => { return (
{Children.map(children, (child) => { if (isValidElement(child)) { return (
{cloneElement(child, { ...child.props || {}, // @ts-expect-error ignore width: iconWidth || child.props.width, // @ts-expect-error ignore height: iconHeight || child.props.height, })}
) } })}
) }