import clsx from 'clsx'; import { ComponentType, ReactNode, useEffect } from 'react'; import featherIcons from 'feather-icons'; import { isValidElementType } from 'react-is'; export interface IconProps { icon: ReactNode | ComponentType; featherIcon?: boolean; } interface Props { icon: ReactNode | ComponentType; feather?: boolean; className?: string; } export function Icon({ icon, feather, className }: Props) { useEffect(() => { if (feather) { featherIcons.replace(); } }, [feather]); if (typeof icon !== 'string') { const Icon = isValidElementType(icon) ? icon : null; return ( ); } if (feather) { return (