Files
pdfer/components/Input.tsx
Thomas Ruoff 0aaccf6966 more styling
2021-02-28 23:28:05 +01:00

34 lines
661 B
TypeScript

import React, { ChangeEvent } from 'react'
export default function Input({
text,
name,
value = '',
placeholder,
onchange,
}: {
text: string
name: string
value?: string
placeholder?: string
onchange: (name: string, event: ChangeEvent<{ value: string }>) => void
}) {
return (
<>
<label htmlFor={name} className="pb-label">
{text}
</label>
<div className="pb-input_wrapper">
<input
type="text"
name={name}
className="pb-input"
placeholder={placeholder}
value={value}
onChange={onchange.bind(null, name)}
/>
</div>
</>
)
}