import React from 'react'
import { Input, Form } from 'antd'
import styles from './Less/input.less'

const InputField = (props: {
    name: string
    label: string
    placeHolder: string
    reuireMessage: string
}): React.ReactElement => {
    const { name, label, placeHolder, reuireMessage } = props

    return (
        <Form.Item
            label={<label className={styles.inputLabel}>{label}</label>}
            name={name}
            rules={[{ required: true, message: reuireMessage }]}
        >
            <Input placeholder={placeHolder} />
        </Form.Item>
    )
}

export default InputField
