type IconProps = { icon: React.FC> | null; // Type it as a React Functional Component className?: string; }; export const Icon = ({ icon: IconComponent, className = '' }: IconProps) => { if (!IconComponent) return null; return (
{' '} {/* Render the functional component */}
); };