import { Flex, Text } from '@metafam/ds'; import type { PropsWithChildren } from 'react'; import { FieldError } from 'react-hook-form'; type FieldProps = PropsWithChildren<{ label: string; error?: FieldError; }>; export const Field: React.FC = ({ children, error, label }) => ( {label} {error?.type === 'required' && (error.message || 'Required')} {error?.type === 'pattern' && (error.message || 'Invalid URL')} {error?.type === 'minLength' && (error.message || 'Too short')} {error?.type === 'maxLength' && (error.message || 'Too long')} {error?.type === 'min' && (error.message || 'Too small')} {error?.type === 'validate' && (error.message || 'Invalid')} {children} ); export const FieldDescription: React.FC = ({ children }) => ( {children} );