import { MarkType } from '../../types/drawing'
import { MARK_TYPE_CONFIG, MarkInputProps } from './MarkStrategy'

interface MarkInputComponentProps extends MarkInputProps {
  markType: MarkType
}

export const MarkInput = ({ markType, ...rest }: MarkInputComponentProps) => {
  const { input: InputComponent } = MARK_TYPE_CONFIG[markType] || {}

  if (typeof InputComponent !== 'undefined') {
    return <InputComponent {...rest} />
  }

  return null
}
