import type { IconWeight } from './Icon'

const weights = ['outline', 'fill']

export const renderPathForWeight = (
  weight: IconWeight,
  path: PaintFunction
): React.ReactNode | null => {
  if (weights.includes(weight)) {
    return path()
  }

  console.error('Unsupported icon weight. Choose from "outline" or "fill".')

  return null
}

export type PaintFunction = () => React.ReactNode | null

export type RenderFunction = (
  weight: IconWeight,
  color: string
) => React.ReactNode | null
