export function handleFocusEvents(element: Element): void {
	element.addEventListener('focus', handleFocusEvent);
	element.addEventListener('blur', handleBlurEvent);
}

function handleFocusEvent(event: Event) {
	const buttonElement = event.target as HTMLElement;
	if (event.type === 'focus') {
		buttonElement.classList.add('focus-visible');
	}
}

function handleBlurEvent(event: Event) {
	const buttonElement = event.target as HTMLElement;
	if (buttonElement && event.type === 'blur') {
		buttonElement.classList.remove('focus-visible');
	}
}
