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

export function useCollectionPageFooter(child: CollectionPageFooterElement) {
  const { isPanelLayout } = useWixPatternsContainer();
  if (isPanelLayout) {
    return (
      <>
        <Divider />
        <Box direction="vertical" padding="SP4" {...child.props} />
      </>
    );
  }
  return <Page.Footer {...child.props} />;
}
