import React from 'react' import { colors } from '../theme' import { useTheme } from '../themeContext' import { Noop } from '../utils/Noop' import { FacialHairProps } from './facialHair/types' import { HairProps } from './hair/types' import { ClothingProps } from './clothing/types' import { Mask } from './Mask' import { BgCircle } from './BgCircle' import { MouthProps } from './mouths/types' import { BodyProps } from './bodies/types' import { HatProps } from './hats/types' import { EyeProps } from './eyes/types' import { DressShirt } from './clothing/DressShirt' import { FaceMask } from './FaceMask' interface BaseProps { eyes: React.ComponentType eyebrows: React.ComponentType mouth: React.ComponentType hair?: { Front: React.ComponentType Back: React.ComponentType hatScale?: number } facialHair: React.ComponentType accessory: React.ComponentType graphic: React.ComponentType hat: { Front: React.ComponentType Back: React.ComponentType } body: { Front: React.ComponentType Back: React.ComponentType } clothing: { Front: React.ComponentType Back: React.ComponentType braStraps?: boolean } clothingColor: keyof typeof colors.clothing hairColor: keyof typeof colors.hair circleColor: keyof typeof colors.bgColors lipColor: keyof typeof colors.lipColors hatColor: keyof typeof colors.clothing faceMaskColor: keyof typeof colors.clothing mask: boolean faceMask: boolean lashes: boolean } export const Base = React.forwardRef( ( { eyes: Eyes, eyebrows: Eyebrows, mouth: Mouth, hair = { Front: Noop, Back: Noop }, facialHair: FacialHair, clothing = { Front: Noop, Back: Noop }, accessory: Accessory, graphic: Graphic, hat = { Front: Noop, Back: Noop }, body, hairColor, clothingColor, circleColor, lipColor, hatColor, faceMaskColor, mask, faceMask, lashes, ...rest }, ref, ) => { const { skin } = useTheme() const { Front: FrontHair, Back: BackHair, hatScale } = hair const { Front: FrontHat, Back: BackHat } = hat const { Front: FrontBody, Back: BackBody } = body const { Front: ClothingFront, Back: ClothingBack, braStraps = true, } = clothing return ( {mask && } {mask && } {!(ClothingFront === Noop && ClothingBack === Noop) && ( )} {!faceMask && } {faceMask && } ) }, )