File size: 834 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import clsx from 'clsx';
import { PatternPreviewPlaceholder } from 'calypso/my-sites/patterns/components/pattern-preview/placeholder';
import type { PatternGalleryFC } from 'calypso/my-sites/patterns/types';

import './style.scss';

const PATTERNS_PER_PAGE_COUNT = 9;

export const PatternGalleryServer: PatternGalleryFC = ( { isGridView, patterns = [] } ) => {
	const patternsToDisplay = patterns.slice( 0, PATTERNS_PER_PAGE_COUNT );

	return (
		<div
			className={ clsx( 'pattern-gallery', {
				'pattern-gallery--grid': isGridView,
			} ) }
		>
			{ patternsToDisplay.map( ( pattern ) => (
				<PatternPreviewPlaceholder
					className={ clsx( {
						'pattern-preview--grid': isGridView,
						'pattern-preview--list': ! isGridView,
					} ) }
					key={ pattern.ID }
					title={ pattern.title }
				/>
			) ) }
		</div>
	);
};