import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; export const LineInput: React.StatelessComponent = ({ children, required, invalid, readOnly, boxed, isSelect, noMargin, noLabel, withButton, labelLeft, labelLeftAuto, hint, message, className, }) => (
{children} {hint &&
{hint}
} {message && (
{message}
)}
); export const LineInputProps = { required: PropTypes.bool, invalid: PropTypes.bool, readOnly: PropTypes.bool, boxed: PropTypes.bool, isSelect: PropTypes.bool, noMargin: PropTypes.bool, noLabel: PropTypes.bool, withButton: PropTypes.bool, labelLeft: PropTypes.bool, labelLeftAuto: PropTypes.bool, hint: PropTypes.string, message: PropTypes.string, }; export const LineInputDefaultProps = { required: false, invalid: false, readOnly: false, boxed: false, isSelect: false, noMargin: false, noLabel: false, withButton: false, labelLeft: false, labelLeftAuto: false, }; LineInput.propTypes = { children: PropTypes.node.isRequired, className: PropTypes.string, ...LineInputProps, }; LineInput.defaultProps = {...LineInputDefaultProps};