import * as React from 'react'; import classNames from 'classnames'; type Props = React.InputHTMLAttributes & { label: string; }; export default ({ className, onChange, label, ...props }: Props) => { const [ value, setValue ] = React.useState(''); const classes = classNames('input open-label', { 'has-content': value && value.length > 0, }); return (
{ setValue(e.target.value); if (onChange) { onChange(e); } }} {...props} />
); };