import { BaseControl } from '@wordpress/components'; import { sprintf, __ } from '@wordpress/i18n'; import { Attributes } from '../../types'; import { Headlights } from './headers/Headlights'; import { HeadlightsMuted } from './headers/HeadlightsMuted'; import { HeadlightsMutedAlt } from './headers/HeadlightsMutedAlt'; import { PillString } from './headers/PillString'; import { SimpleString } from './headers/SimpleString'; import { StringSmall } from './headers/StringSmall'; import { UnsupportedTheme } from './misc/Unsupported'; type HeaderSelectProps = { attributes: Attributes; onClick: (slug: string) => void; }; const unsupportedWithCssVars = ['headlightsMutedAlt']; export const HeaderSelect = ({ attributes, onClick }: HeaderSelectProps) => { const { headerType, ...attributesWithoutHeaderType }: Attributes = attributes; const { bgColor } = attributes; const types = { none: __('None', 'code-block-pro'), headlights: __('Headlights', 'code-block-pro'), headlightsMuted: __('Headlights muted', 'code-block-pro'), headlightsMutedAlt: __('Headlights muted alt', 'code-block-pro'), simpleString: __('Simple string', 'code-block-pro'), stringSmall: __('String muted', 'code-block-pro'), pillString: __('Pill string', 'code-block-pro'), }; const isUnsupported = bgColor?.startsWith('var('); return (