import { BaseControl } from '@wordpress/components'; import { sprintf, __ } from '@wordpress/i18n'; import { Attributes } from '../../types'; import { BlockLeft } from './seemore/BlockLeft'; import { BlockRight } from './seemore/BlockRight'; import { RoundCenter } from './seemore/RoundCenter'; type SeeMoreSelectProps = { attributes: Attributes; onClick: (slug: string) => void; }; export const SeeMoreSelect = ({ attributes, onClick }: SeeMoreSelectProps) => { const { seeMoreType, ...attributesWithoutSeeMoreType }: Partial = attributes; const { bgColor } = attributes; const types = { none: __('None', 'code-block-pro'), roundCenter: __('See more center', 'code-block-pro'), blockLeft: __('See more left', 'code-block-pro'), blockRight: __('See more right', 'code-block-pro'), }; return (
{Object.entries(types).map(([slug, type]) => ( ))}
); }; export const SeeMoreType = ( props: Partial & { context?: string }, ) => { const { seeMoreType, enableMaxHeight, context } = props; if (!enableMaxHeight) return null; if (seeMoreType === 'roundCenter') { return ; } if (seeMoreType === 'blockLeft') { return ; } if (seeMoreType === 'blockRight') { return ; } return null; };