import { useLocation } from '@reach/router'; import Kit from '../models/kit'; import KitListItem from './kit-list-item'; import NewPageKitListItem from '../../../../onboarding/assets/js/components/new-page-kit-list-item'; import { CssGrid } from '@elementor/app-ui'; export default function KitList( props ) { const location = useLocation(); const referrer = new URLSearchParams( location.pathname.split( '?' )?.[ 1 ] ).get( 'referrer' ); return ( { 'onboarding' === referrer && } { props.data.map( ( model, index ) => ( // The + 1 was added in order to start the map.index from 1 and not from 0. ) ) } ); } KitList.propTypes = { data: PropTypes.arrayOf( PropTypes.instanceOf( Kit ) ), queryParams: PropTypes.shape( { search: PropTypes.string, } ), source: PropTypes.string, };