import React from 'react'

import Popover, { type PopoverProps } from '../Popover/Popover'

type ExposedFilterPopoverProps = {
  position?: PopoverProps['position']
  disableCloseOnScroll?: PopoverProps['disableCloseOnScroll']
  maxWidth?: string
  popoverContent: PopoverProps['popoverContent']
  children: PopoverProps['children']
}

const ExposedFilterPopover = ({
  position = 'bottom-start',
  disableCloseOnScroll = true,
  maxWidth,
  popoverContent,
  children,
}: ExposedFilterPopoverProps): React.JSX.Element => {
  return (
    <Popover
      position={position}
      disableCloseOnScroll={disableCloseOnScroll}
      noPadding
      maxWidth={maxWidth}
      popoverContent={popoverContent}
    >
      {children}
    </Popover>
  )
}

export default ExposedFilterPopover
