2026-03-27 16:20:46 +03:00

32 lines
655 B
TypeScript

import type { BaseFieldControlProps } from "../types"
import { Input } from "@/shared/components/ui/input"
export type TextInputFieldProps = BaseFieldControlProps<string> & {
placeholder?: string
type?: React.HTMLInputTypeAttribute
}
export function TextInputField({
value,
onChange,
onBlur,
name,
disabled,
invalid,
placeholder,
type = "text",
}: TextInputFieldProps) {
return (
<Input
value={value}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
name={name}
disabled={disabled}
aria-invalid={invalid || undefined}
placeholder={placeholder}
type={type}
/>
)
}