import React, { useState } from 'react'; import { GridSectionsState, SectionRange } from './GridSectionsState'; import { FiltersMap } from '@wix/bex-core'; import { Box } from '@wix/design-system'; import { observer } from 'mobx-react-lite'; import { GridContent, GridContentBaseProps } from '../Grid/GridContent'; import { GridSectionHeader } from './GridSectionHeader'; import { GridSectionsSectionState } from './GridSectionsSectionState'; export interface GridSectionAndRepeaterProps extends GridContentBaseProps { sectionDescriptor: SectionRange; state: GridSectionsState; } function _GridSectionAndRepeater( props: GridSectionAndRepeaterProps, ) { const { sectionDescriptor, imagePlacement, layoutType, dragAndDrop } = props; const { range } = sectionDescriptor; const [state] = useState( () => new GridSectionsSectionState({ gridSections: props.state, sectionDescriptor, imagePlacement, layoutType, draggable: dragAndDrop ? 'draggable' : 'none', }), ); return ( ); } export const GridSectionAndRepeater = observer(_GridSectionAndRepeater);