refactor form input fields

This commit is contained in:
Thomas Ruoff
2020-09-02 00:01:18 +02:00
committed by Thomas Ruoff
parent 0ed66962ba
commit b92ff0e3d8
5 changed files with 149 additions and 179 deletions

View File

@@ -0,0 +1,17 @@
import React from 'react'
import InputWrapper from './inputWrapper'
interface InputProps extends React.InputHTMLAttributes<T> {
label: string
}
export default function Input(props: InputProps) {
const { label, required, type = 'text', ...rest } = props
return (
<InputWrapper label="label" required={required}>
<input type={type} required={required} className="input-text" {...rest} />
</InputWrapper>
)
}