import React, { CSSProperties, forwardRef } from 'react'; import classNames from 'classnames'; import type { LucideIcon } from 'lucide-react'; import { ICON_PIXEL_SIZES } from './iconSizes'; import type { IconSize } from './types'; import * as iconStyles from './style.css'; export type IconProps = { src: LucideIcon; size?: IconSize; filled?: boolean; className?: string; style?: CSSProperties; fill?: string; } & Omit, 'fill'>; export const Icon = forwardRef( ( { className, size = '400', filled = false, src: LucideIconComponent, style, fill, ...props }, ref, ) => { const pixelSize = ICON_PIXEL_SIZES[size]; let iconStyle = style; if (size === 'Inherit') { iconStyle = { width: '1em', height: '1em', ...style }; } else if (pixelSize) { iconStyle = { width: pixelSize, height: pixelSize, ...style }; } return ( ); }, ); Icon.displayName = 'Icon';