'use client'; import { Input, TextField as AriaTextField, TextArea as AriaTextArea, type TextFieldProps as AriaTextFieldProps, type ValidationResult } from 'react-aria-components/TextField'; import {Label, FieldError, Description} from './Form'; import './TextField.css'; import type React from 'react'; export interface TextFieldProps extends AriaTextFieldProps { label?: string; description?: string; errorMessage?: string | ((validation: ValidationResult) => string); placeholder?: string; inputRef?: React.Ref; } export function TextField({ label, description, errorMessage, placeholder, inputRef, ...props }: TextFieldProps) { return ( {label && } {description && {description}} {errorMessage} ); } export function TextArea({ label, description, errorMessage, placeholder, inputRef, ...props }: TextFieldProps) { return ( {description && {description}} {errorMessage} ); }