diff --git a/components/inputs/Input.tsx b/components/inputs/Input.tsx index b60e750..34c5140 100644 --- a/components/inputs/Input.tsx +++ b/components/inputs/Input.tsx @@ -1,20 +1,12 @@ -interface Props { +import { DetailedHTMLProps, InputHTMLAttributes } from "react"; + +interface InputProps + extends DetailedHTMLProps, HTMLInputElement> { label?: string; - type?: string; - list?: string; - name?: string; - onChange?: (e: React.ChangeEvent) => void; - value: number | string | undefined; - min?: string | number | undefined; - checked?: boolean; - onBlur?: (e: React.ChangeEvent) => void; - disabled?: boolean; error?: string; - placeholder?: string; - width?: string; } -const Input = (props: Props) => ( +const Input = (props: InputProps) => (
( list={props.list} name={props.name || "text-input"} onChange={props.onChange} + onFocus={props.onFocus} value={props.value} checked={props.checked} min={props.type === "datetime-local" ? props.min : undefined}