import React from 'react';
import { Box, Page } from '@wix/design-system';
import { CollectionPageContentElement } from '../../components/CollectionPageContent';
import { useWixPatternsContainer } from '@wix/bex-core/react';

export function useCollectionPageContent(child: CollectionPageContentElement) {
  const { isPanelLayout } = useWixPatternsContainer();
  if (isPanelLayout) {
    return (
      <Box
        {...child.props}
        direction="vertical"
        minHeight={0}
        height="100%"
        flex={1}
      />
    );
  }
  return <Page.Content {...child.props} />;
}
