import FieldWarning from '@/components/common/FieldWarning' import FormField from '@/components/common/FormField' import { inputClass } from '@/lib/utils' import type { FC, ReactNode } from 'react' type Props = { label: string value: string onChange: (value: string) => void warnings?: string[] errors?: string[] disabled?: boolean type?: string placeholder?: string className?: string after?: ReactNode onBlur?: () => void } const PostTextField: FC = ( { label, value, onChange, warnings, errors, disabled, type = 'text', placeholder, className, after, onBlur }, ) => ( {({ describedBy, invalid }) => ( <> onChange (ev.target.value)} aria-describedby={describedBy} aria-invalid={invalid} className={inputClass (invalid, className)}/> {after} )} ) export default PostTextField