import { Button } from '@automattic/components'; import { useResizeObserver } from '@wordpress/compose'; import { Icon, copy } from '@wordpress/icons'; import clsx from 'clsx'; import { useTranslate } from 'i18n-calypso'; import './style.scss'; type PatternPreviewPlaceholderProps = { className?: string; title?: string; }; export function PatternPreviewPlaceholder( { className, title }: PatternPreviewPlaceholderProps ) { const translate = useTranslate(); const [ resizeObserver, nodeSize ] = useResizeObserver(); const isPreviewLarge = nodeSize?.width ? nodeSize.width > 960 : true; const copyButtonText = isPreviewLarge ? translate( 'Copy pattern', { comment: 'Button label for copying a pattern', textOnly: true, } ) : translate( 'Copy', { comment: 'Button label for copying a pattern', textOnly: true, } ); return (
{ resizeObserver }
{ title }
); }