import { __ } from "@wordpress/i18n";
import { PanelBody } from "@wordpress/components";
import { TabControls } from "../../components";
import {
MoreResultGeneralTab,
PopupCanvasGeneralTab,
PresetTab,
QueryFilterGeneralTab,
SearchButtonGeneralTab,
SearchResultGeneralTab,
} from "./generalTab";
import {
MoreResultStyleTab,
PopupCanvasStyleTab,
PresetStyleTab,
SearchButtonStyleTab,
SearchResultStyleTab,
} from "./styleTab";
import { usePanelBodyContext } from "../../context";
export const Inspector = ({ attributes, setAttributes }) => {
const { openPanel, togglePanelBody } = usePanelBodyContext();
const { blockName, displayType } = attributes;
return (
<>
togglePanelBody("general")}
>
{openPanel === "general" && (
)}
togglePanelBody("query_filter")}
>
{openPanel === "query_filter" && (
)}
togglePanelBody("search_button")}
>
{openPanel === "search_button" && (
)}
{displayType === "popup" && (
togglePanelBody("popup_canvas")}
>
{openPanel === "popup_canvas" && (
)}
)}
togglePanelBody("search_result")}
>
{openPanel === "search_result" && (
)}
togglePanelBody("more_result")}
>
{openPanel === "more_result" && (
)}
>
);
};