import React , { ReactNode } from 'react' ; import { LineColorMap } from '~/src/constants/lines' ; import * as styles from './styles.css' ; interface Props { children ? : ReactNode ; className ? : string ; color ? : string ; } export const LineIcon = ( { children , className , color } ) => { let backgroundColor = color ; if ( typeof children === 'string' && LineColorMap [ children ] ) { backgroundColor = `var(${ LineColorMap [ children ] })` ; } return ( < div className = { `${ styles . LineIcon } ${ className || '' }` } style = { { backgroundColor } } > { children || ' ' } < /div>); } ;