import { createElement, Component, useState, Fragment } from '@wordpress/element' import DraggableItems from './DraggableItems' import cls from 'classnames' import Panel, { PanelMetaWrapper } from '../../../options/options/ct-panel' import { getValueFromInput } from '../../../options/helpers/get-value-from-input' import { __ } from 'ct-i18n' import { Slot } from '@wordpress/components' import OptionsPanel from '../../../options/OptionsPanel' import BuilderTemplates from './builder-sidebar/Templates' import SecondaryItems from './builder-sidebar/SecondaryItems' import InvisiblePanels from './builder-sidebar/InvisiblePanels' const AvailableItems = ({ allBuilderSections, builderValue, builderValueDispatch, inlinedItemsFromBuilder }) => { // items | options const [currentTab, setCurrentTab] = useState('items') const secondaryItems = ct_customizer_localizations.header_builder_data.secondary_items.header const allItems = ct_customizer_localizations.header_builder_data.header const headerOptions = ct_customizer_localizations.header_builder_data.header_data .header_options return (
{fills => fills.length === 0 ? (

{__('Global Header', 'blocksy')}

{__( 'Set one of these headers as a global one. You can edit them idependently.', 'blocksy' )}
) : ( fills ) }
{currentTab === 'options' && ( { builderValueDispatch({ type: 'BUILDER_GLOBAL_SETTING_ON_CHANGE', payload: { optionId, optionValue, values: Array.isArray( builderValue.settings ) || Object.keys( builderValue.settings || {} ).length === 0 ? getValueFromInput( headerOptions, Array.isArray( builderValue.settings ) ? {} : builderValue.settings || {} ) : builderValue.settings } }) }} options={headerOptions} value={ Array.isArray(builderValue.settings) || Object.keys(builderValue.settings || {}) .length === 0 ? getValueFromInput( headerOptions, Array.isArray(builderValue.settings) ? {} : builderValue.settings || {} ) : builderValue.settings } /> )}
) } export default AvailableItems