import { addFilter } from '@wordpress/hooks';
import {
	iconDynamicField,
	iconDynamicImage,
	iconDynamicRepeater,
	iconDynamicMeta,
	iconDynamicLink,
	iconDynamicTerms,
	iconDynamicCalendar,
	iconMapsListing,
	iconActiveTags,
	iconCheckboxesFilter,
	iconActiveFilters,
	iconCheckRangeFilter,
	iconDateRangeFilter,
	iconDatePeriodFilter,
	iconPagination,
	iconRadioFilter,
	iconRangeFilter,
	iconAlphabet,
	iconSearch,
	iconApplyButton,
	iconColorImage,
	iconHidden,
	iconSelectFilter,
	iconRemoveFilters,
	iconRatingFilter,
	iconSorting,
} from './icons';

// Add module icons to the icon library.
addFilter('divi.iconLibrary.icon.map', 'jetEngineDiviViews', (icons) => {
	return {
		...icons, // This is important. Without this, all other icons will be overwritten.
		[iconDynamicField.name]: iconDynamicField,
		[iconDynamicImage.name]: iconDynamicImage,
		[iconDynamicRepeater.name]: iconDynamicRepeater,
		[iconDynamicMeta.name]: iconDynamicMeta,
			[iconDynamicLink.name]: iconDynamicLink,
			[iconDynamicTerms.name]: iconDynamicTerms,
			[iconDynamicCalendar.name]: iconDynamicCalendar,
			[iconMapsListing.name]: iconMapsListing,
		[iconActiveTags.name]: iconActiveTags,
		[iconCheckboxesFilter.name]: iconCheckboxesFilter,
		[iconActiveFilters.name]: iconActiveFilters,
		[iconCheckRangeFilter.name]: iconCheckRangeFilter,
		[iconDateRangeFilter.name]: iconDateRangeFilter,
		[iconDatePeriodFilter.name]: iconDatePeriodFilter,
		[iconPagination.name]: iconPagination,
		[iconRadioFilter.name]: iconRadioFilter,
		[iconRangeFilter.name]: iconRangeFilter,
		[iconAlphabet.name]: iconAlphabet,
		[iconSearch.name]: iconSearch,
		[iconApplyButton.name]: iconApplyButton,
		[iconColorImage.name]: iconColorImage,
		[iconHidden.name]: iconHidden,
		[iconSelectFilter.name]: iconSelectFilter,
		[iconRemoveFilters.name]: iconRemoveFilters,
		[iconRatingFilter.name]: iconRatingFilter,
		[iconSorting.name]: iconSorting,
	};
});
