Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { CSSTransition } from 'react-transition-group';
import PageLayoutSelector from './page-layout-selector';
import { partition } from 'lodash';
/**
* Internal dependencies
*/
import { SiteVertical } from '../../stores/onboard/types';
import DesignCard from './design-card';
import './style.scss';
import { VerticalsTemplates } from '@automattic/data-stores';
type Template = VerticalsTemplates.Template;
const VERTICALS_TEMPLATES_STORE = VerticalsTemplates.register();
const DesignSelector: FunctionComponent = () => {
const siteVertical = useSelect(
select => select( 'automattic/onboard' ).getState().siteVertical as SiteVertical
);
const templates =
useSelect( select => select( VERTICALS_TEMPLATES_STORE ).getTemplates( siteVertical.id ) ) ??
[];
const [ designs, otherTemplates ] = partition(
templates,
( { category } ) => category === 'home'
);
const [ selectedDesign, setSelectedDesign ] = useState< Template | undefined >();