import React, { useState } from 'react';
import { Box } from '@wix/design-system';
import { observer } from 'mobx-react-lite';
import { GridContent } from '../Grid/GridContent';
import { GridSectionHeader } from './GridSectionHeader';
import { GridSectionsSectionState } from './GridSectionsSectionState';
function _GridSectionAndRepeater(props) {
    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 (React.createElement(Box, { direction: "vertical", width: "100%", dataHook: "grid-section-and-repeater" },
        React.createElement(GridSectionHeader, { sectionDescriptor: sectionDescriptor, state: state }),
        React.createElement(GridContent, { ...props, paddingTop: layoutType === 'list' ? undefined : 'SP4', range: range, state: state.gridBase, withInfiniteScrollLoader: state.isLast })));
}
export const GridSectionAndRepeater = observer(_GridSectionAndRepeater);
//# sourceMappingURL=GridSectionAndRepeater.js.map