import { BaseControl } from '@wordpress/components'; import { sprintf, __ } from '@wordpress/i18n'; import { Attributes } from '../../types'; import { SimpleStringEnd } from './footers/SimpleStringEnd'; import { SimpleStringStart } from './footers/SimpleStringStart'; type FooterSelectProps = { attributes: Attributes; onClick: (slug: string) => void; }; export const FooterSelect = ({ attributes, onClick }: FooterSelectProps) => { const { footerType, ...attributesWithoutFooterType } = attributes; const { bgColor } = attributes; const types = { none: __('None', 'code-block-pro'), simpleStringEnd: __('Simple string end', 'code-block-pro'), simpleStringStart: __('Simple string start', 'code-block-pro'), }; return (
{Object.entries(types).map(([slug, type]) => ( ))}
); }; export const FooterType = (props: Attributes) => { const { footerType } = props; if (footerType === 'simpleStringEnd') { return ; } if (footerType === 'simpleStringStart') { return ; } return null; };