import React, { ReactElement } from 'react'
// import { HasError } from './ErrorInput'

export interface IErrorFieldProps extends React.PropsWithChildren{
	error: string | undefined | null,
	children: ReactElement
} 

export default function ErrorField(props: React.PropsWithChildren<IErrorFieldProps>) {
	return (
			// <div className="field">
			// 	<p className="control">
			// 		{props.children}
			// 	</p>
			// 	{HasError(props.error) &&
			// 		<p className="help is-danger">{props.error}</p>
			// 	}							
			// </div>
		<>
			{props.children}
			<div className="invalid-feedback">{props.error}</div>
		</>
	)
}
