export const formatErrorMessage = (errors: any): string => { if (typeof errors === 'string') return errors if (Array.isArray(errors)) return errors.join(', ') if (typeof errors === 'object' && errors !== null) return Object.values(errors).flat().join(', ') return 'An error occurred' }