| 1 |
import { __ } from "@wordpress/i18n"; |
| 2 |
import { PanelBody } from "@wordpress/components"; |
| 3 |
import SharedInspectors from "../shared/inspectors"; |
| 4 |
import { GridThreeGeneralTab } from "./generalTab"; |
| 5 |
import { usePanelBodyContext } from "../../context"; |
| 6 |
|
| 7 |
const Inspector = ({ attributes, setAttributes, isSelected }) => { |
| 8 |
// const { togglePanelBody, openedAccordion } = manageOpenAccordion(); |
| 9 |
const { openPanel, togglePanelBody } = usePanelBodyContext(); |
| 10 |
|
| 11 |
return ( |
| 12 |
<> |
| 13 |
<PanelBody |
| 14 |
title={__("General", "post-carousel")} |
| 15 |
opened={openPanel === "general"} |
| 16 |
onToggle={() => togglePanelBody("general")} |
| 17 |
initialOpen={true} |
| 18 |
> |
| 19 |
{openPanel === "general" && ( |
| 20 |
<GridThreeGeneralTab attributes={attributes} setAttributes={setAttributes} /> |
| 21 |
)} |
| 22 |
</PanelBody> |
| 23 |
<SharedInspectors |
| 24 |
attributes={attributes} |
| 25 |
setAttributes={setAttributes} |
| 26 |
togglePanelBody={togglePanelBody} |
| 27 |
openedAccordion={openPanel} |
| 28 |
/> |
| 29 |
</> |
| 30 |
); |
| 31 |
}; |
| 32 |
|
| 33 |
export default Inspector; |
| 34 |
|