class EdsCDetails {

	constructor(selector = 'data-eds-c-details'){
		this.selector = `[${selector}]`;
	}

	init() {
		const componentElement = document.querySelector(this.selector);
		if (!componentElement) {
			return;
		}

		componentElement.addEventListener('click', () => {
			componentElement.getAttribute('aria-expanded') === 'true' ? componentElement.setAttribute('aria-expanded', false) : componentElement.setAttribute('aria-expanded', true);
		});
	}
}

export default EdsCDetails;

