import { PremiumBadge } from '@automattic/components'; import clsx from 'clsx'; import { RefObject } from 'react'; import { preventWidows } from 'calypso/lib/formatting'; import './style.scss'; type PatternsSectionProps = { title: string; id?: string; forwardRef?: RefObject< HTMLDivElement >; description: string; theme?: 'blue' | 'dark' | 'gray'; bodyFullWidth?: boolean; children: React.ReactNode; isPremium?: boolean; }; export const PatternsSection = ( { title, forwardRef, id, description, theme, bodyFullWidth, children, isPremium, }: PatternsSectionProps ) => { const sectionProps = id ? { id } : {}; return (
{ isPremium && (
) }

{ title }

{ preventWidows( description ) }
{ children }
); };