| 1 |
import { __ } from "@wordpress/i18n"; |
| 2 |
import { PanelBody } from "@wordpress/components"; |
| 3 |
import { usePanelBodyContext } from "../../context"; |
| 4 |
import { TabControls } from "../../components"; |
| 5 |
|
| 6 |
import { |
| 7 |
SmartListsGeneralTab, |
| 8 |
SmartListsStyleTab, |
| 9 |
IconImageGeneralTab, |
| 10 |
IconImageStyleTab, |
| 11 |
ContentGeneralTab, |
| 12 |
ContentStyleTab, |
| 13 |
} from "./generalTab"; |
| 14 |
|
| 15 |
import { VisibilityTab, AdvancedTab } from "../shared/advancedTab"; |
| 16 |
|
| 17 |
const Inspector = ({ attributes, setAttributes }) => { |
| 18 |
const { openPanel, togglePanelBody } = usePanelBodyContext(); |
| 19 |
|
| 20 |
return ( |
| 21 |
<> |
| 22 |
<PanelBody |
| 23 |
title={__("General", "post-carousel")} |
| 24 |
opened={openPanel === "general"} |
| 25 |
onToggle={() => togglePanelBody("general")} |
| 26 |
initialOpen={true} |
| 27 |
> |
| 28 |
{openPanel === "general" && ( |
| 29 |
<TabControls |
| 30 |
attributes={attributes} |
| 31 |
setAttributes={setAttributes} |
| 32 |
GeneralTab={SmartListsGeneralTab} |
| 33 |
GeneralTabTitle="Presets" |
| 34 |
StyleTab={SmartListsStyleTab} |
| 35 |
/> |
| 36 |
)} |
| 37 |
</PanelBody> |
| 38 |
|
| 39 |
<PanelBody |
| 40 |
title={__("Icon / Image", "post-carousel")} |
| 41 |
opened={openPanel === "icon-image"} |
| 42 |
onToggle={() => togglePanelBody("icon-image")} |
| 43 |
> |
| 44 |
{openPanel === "icon-image" && ( |
| 45 |
<TabControls |
| 46 |
attributes={attributes} |
| 47 |
setAttributes={setAttributes} |
| 48 |
GeneralTab={IconImageGeneralTab} |
| 49 |
StyleTab={IconImageStyleTab} |
| 50 |
/> |
| 51 |
)} |
| 52 |
</PanelBody> |
| 53 |
|
| 54 |
<PanelBody |
| 55 |
title={__("Content", "post-carousel")} |
| 56 |
opened={openPanel === "content"} |
| 57 |
onToggle={() => togglePanelBody("content")} |
| 58 |
> |
| 59 |
{openPanel === "content" && ( |
| 60 |
<TabControls |
| 61 |
attributes={attributes} |
| 62 |
setAttributes={setAttributes} |
| 63 |
GeneralTab={ContentGeneralTab} |
| 64 |
StyleTab={ContentStyleTab} |
| 65 |
/> |
| 66 |
)} |
| 67 |
</PanelBody> |
| 68 |
|
| 69 |
<PanelBody |
| 70 |
title={__("Advanced", "post-carousel")} |
| 71 |
opened={openPanel === "advance"} |
| 72 |
onToggle={() => togglePanelBody("advance")} |
| 73 |
> |
| 74 |
<TabControls |
| 75 |
attributes={attributes} |
| 76 |
setAttributes={setAttributes} |
| 77 |
displayIcon={false} |
| 78 |
initialTab="visibility" |
| 79 |
VisibilityTab={VisibilityTab} |
| 80 |
AdvancedTab={AdvancedTab} |
| 81 |
/> |
| 82 |
</PanelBody> |
| 83 |
</> |
| 84 |
); |
| 85 |
}; |
| 86 |
|
| 87 |
export default Inspector; |
| 88 |
|