import React from "react";

import CallLogContainer from "./CallLogContainer";
import withBasePackage from "../../general/HOCs/withBasePackage";
import { withReduxProvider } from "../../general/HOCs";
import useStartTriggereringCall from "../../call-pop/hooks/useStartTriggereringCall";
import { useFetchNotificationCount } from "../../general/hooks";

// Base component
const EnhancedCallLogContainer = () => {
  const { makeCall } = useStartTriggereringCall();

  const { notificationCount } = useFetchNotificationCount();

  return (
    <CallLogContainer
      makeCall={makeCall}
      onOpenModalCall={() => {}}
      missedCallCount={notificationCount?.missed_call || 0}
    />
  );
};

// Export both the base and wrapped versions
export { EnhancedCallLogContainer };
export default withReduxProvider(withBasePackage(EnhancedCallLogContainer));
