import NotificationSidePanel from './components/NotificationSidePanel';
import { useNotificationSidePanelController } from './useNotificationSidePanelController';

type NotificationsSidePanelAdapterProps = {
  open: boolean;
  onClose: () => void;
};

const NotificationsSidePanelAdapter = ({
  open,
  onClose,
}: NotificationsSidePanelAdapterProps) => {
  const { headerNode, bodyNode, handleClose, onPanelOpen, onPanelAfterClose } =
    useNotificationSidePanelController({
      onClose,
    });

  return (
    <NotificationSidePanel
      open={open}
      onClose={handleClose}
      onOpen={onPanelOpen}
      onAfterClose={onPanelAfterClose}
      header={headerNode}
      body={bodyNode}
    />
  );
};

export default NotificationsSidePanelAdapter;
