import React from 'react';

const HIDE_STYLE = { display: 'none' };

interface Props {
	hidden?: boolean;
}

export const HideableElement: React.FC<Props> = ({ hidden, children }) => (
	<div aria-hidden={!!hidden} style={!!hidden ? HIDE_STYLE : undefined}>
		{children}
	</div>
);
