import { Panel, PanelBody } from '@wordpress/components'; import { PluginSidebar } from '@wordpress/edit-post'; import React, { useState } from 'react'; import GeneralPanel from './components/GeneralPanel'; import { PanelTypes } from './components/meta.schema'; export const Plugin = () => { const [activePanel, setActivePanel] = useState(PanelTypes.GENERAL); const togglePanel = (panel: string | null) => { setActivePanel((prevActivePanel: any) => prevActivePanel === panel ? null : panel, ); }; return ( } > togglePanel(PanelTypes.GENERAL)} > {activePanel === PanelTypes.GENERAL && } {/**/} ); };