/** * External dependencies */ import classNames from 'classnames'; /** * WordPress dependencies */ import { Panel, PanelBody, RadioControl, SelectControl, ToggleControl, } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import useSiteLoadingState from '../../hooks/use-loading-state'; import useEntityRecordState from '../../hooks/use-entity-record-state'; import useSearchOptions from '../../hooks/use-search-options'; import ColorControl from './color-control'; import ExcludedPostTypesControl from './excluded-post-types-control'; import ThemeControl from './theme-control'; /* eslint-disable react/jsx-no-bind */ /** * Customization/configuration tab for the sidebar. * * @returns {Element} component instance */ export default function SidebarOptions() { const { color, excludedPostTypes, infiniteScroll, resultFormat, setColor, setExcludedPostTypes, setInfiniteScroll, setResultFormat, setShowLogo, setSort, setSortEnabled, setTheme, setTrigger, showLogo, sort, sortEnabled, theme, trigger, } = useSearchOptions(); const { isSaving } = useEntityRecordState(); const { isLoading } = useSiteLoadingState(); const isDisabled = isSaving || isLoading; // TODO: ask the user if they attempt to navigate away from the page with pending changes. return ( ); }