import { useEffect } from '@wordpress/element'; import { Button } from '@wordpress/components'; import Half3Icon from 'blockbite-icons/dist/Half3'; import ResponsivePanel from '@components/DesignPanel/ResponsivePanel'; import ControlPanel from '@components/DesignPanel/ControlPanel'; import ControlExpandPanel from '@components/DesignPanel/ControlExpandPanel'; import { PanelEditorWrapperProps } from '@components/DesignPanel/types'; import PanelEditorDropdown from '@components/DesignPanel/PanelEditorDropdown'; import PanelBookmarks from '@components/DesignPanel/PanelBookmarks'; export const PanelEditor: React.FC = ({ panels, panelId = null, setPanelId = null, content = null, showResponsivePanel = true, setCurrentTab = () => {}, }) => { const currentCategory = panels.find((p) => p.id === panelId); const firstPanelId = panels[0].id; useEffect(() => { if (!panelId && content?.panel !== 'style') { setPanelId(firstPanelId); } }, []); return ( <>
{!panelId && } {currentCategory && showResponsivePanel && } {currentCategory ? ( currentCategory.expand ? ( ) : ( ) ) : null} ); }; export default PanelEditor;