export const elements = {
	searchInput: document.querySelector('.search__field'),
	searchForm: document.querySelector('.search'),
	searchResList: document.querySelector('.results__list'),
	searchRes: document.querySelector('.results')
}

export const elementStrings = {
	loader: 'loader',
}

export const renderLoader = parent => {
	//show loading icon
	
	const loader = `
		<div class=${elementStrings.loader}>
			<svg>
				<use href="img/icons.svg#icon-cw"></use>
			</svg>
		</div>
	`;
	parent.insertAdjacentHTML('afterbegin', loader);
}

export const removeLoader = () => {
	const loader = document.querySelector(`.${elementStrings.loader}`);
	if (loader) loader.parentElement.removeChild(loader);
};