import React, { ChangeEvent } from 'react'

export default function Input({
  text,
  name,
  value = '',
  placeholder,
  onchange,
}: {
  text: string
  name: string
  value?: string
  placeholder?: string
  onchange: (name: string, event: ChangeEvent<{ value: string }>) => void
}) {
  return (
    <label>
      {text}
      <input
        className={name}
        type="text"
        placeholder={placeholder}
        onChange={onchange.bind(null, name)}
        value={value}
      />
    </label>
  )
}
