import PropTypes from 'prop-types';
import { Form } from 'react-bootstrap';

const RegisterInput = ({
    name, label, value, onChange, className, groupClassName, placeholder, ...rest
}) => {
    return (
        <Form.Group className={`mb-2 ${groupClassName || ''}`}>
            <Form.Label className="label-text">{label}</Form.Label>
            <Form.Control onChange={onChange} name={name || ''} className={`form-control inputbox ${className || ''}`} placeholder={placeholder || ''} {...rest} required />
        </Form.Group>
    );
};

RegisterInput.propTypes = {
    name: PropTypes.string,
    label: PropTypes.string,
    value: PropTypes.string,
    placeholder: PropTypes.string,
    onChange: PropTypes.func,
    className: PropTypes.string,
    groupClassName: PropTypes.string,
};

export default RegisterInput;
