'use client'; import React from 'react'; interface BaseFormFieldProps { label: string; name: string; required?: boolean; error?: string; touched?: boolean; className?: string; children: React.ReactNode; } /** * Base form field wrapper component that provides consistent styling * for labels, error messages, and layout across all form components. */ export default function BaseFormField({ label, name, required = false, error, touched, className = '', children, }: BaseFormFieldProps) { const showError = touched && error; return (
{children} {showError && (

{error}

)}
); } // Common input class names for consistency export const inputBaseClasses = ` w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:bg-gray-100 disabled:cursor-not-allowed `; export const getInputClasses = (hasError: boolean): string => ` ${inputBaseClasses} ${hasError ? 'border-red-500' : 'border-gray-300'} `;