import { PanelBody } from '@wordpress/components'; import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Theme } from 'shiki'; import { useSettingsStoreReady } from '../../state/settings'; import { useThemeStore } from '../../state/theme'; import { AttributesPropsAndSetter } from '../../types'; import { ThemeFilter } from './ThemeFilter'; import { ThemeSelect } from './ThemeSelect'; export const ThemesPanel = ({ bringAttentionToThemes, attributes, setAttributes, }: AttributesPropsAndSetter & { bringAttentionToThemes?: boolean }) => { const { updateThemeHistory } = useThemeStore(); const [search, setSearch] = useState(''); const ready = useSettingsStoreReady(); return ( {ready && } {ready && ( { setAttributes({ theme }); updateThemeHistory({ theme }); }} /> )} ); };