Files
pfadi-bussle/components/input.tsx
2021-06-16 23:36:28 +02:00

25 lines
532 B
TypeScript

import React from 'react'
import InputWrapper from './inputWrapper'
type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
label: string
}
export default function Input(props: InputProps) {
const { label, name, required, type = 'text', ...rest } = props
return (
<InputWrapper label={label} name={name} required={required}>
<input
type={type}
required={required}
className="input-text"
id={name}
name={name}
{...rest}
/>
</InputWrapper>
)
}