import FieldControl from '../components/FieldControl';

const HtmlField = ( {field, value} ) => {
	// 'value' for 'div'-types, 'html' for 'html-content'-types'
	const htmlContent = field.html || value || '';

	return (
		<FieldControl
			label={field.label}
			help={field.description}
			id={field.id}
		>
			<div
				id={field.html_id}
				className={field.html_class}
				dangerouslySetInnerHTML={{__html: htmlContent}}
			/>
		</FieldControl>
	);
};
export default HtmlField;
