import { jsx, jsxs, Fragment } from "react/jsx-runtime";
import { ChatChannelList } from "./ChatChannelList.js";
import { ChatHeaderNavigation } from "./ChatHeaderNavigation.js";
import { SkeletonList } from "../SkeletonList.js";
/* empty css                                   */
const TableChatChannelHeader = ({
  title = "Create new Chat",
  channels = [],
  selectedChannelOrChatId,
  onBack,
  onChannelSelect,
  onMenuClick,
  onSearchClick,
  onMoreClick,
  showChannelList,
  setShowPinnedMsg,
  onThreadClick,
  isSearchOpen,
  headerConfig,
  showAddChatBtn = true,
  showCheckbox,
  handleChatName,
  filterChannelsByTitle,
  loadingChannels,
  selectedChannelInfo,
  handleToast,
  onPinnedChatClick,
  onDeleteTopics,
  selectedChat,
  handleChatSelect,
  isCreateNewChatOpen,
  setIsCreateNewChatOpen
}) => {
  const handleChannelSelect = (channelId, channelItem) => {
    onChannelSelect == null ? void 0 : onChannelSelect(channelId, channelItem);
  };
  const channelsToShow = channels;
  return /* @__PURE__ */ jsx("div", { className: "table-left-panel-container", children: loadingChannels ? /* @__PURE__ */ jsx("div", { style: { height: "100%" }, children: /* @__PURE__ */ jsx(SkeletonList, { text: "Loading messages..." }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
    /* @__PURE__ */ jsx(
      ChatHeaderNavigation,
      {
        filterChannelsByTitle,
        handleChatName,
        handleToast,
        headerConfig,
        isCreateNewChatOpen,
        isSearchOpen,
        selectedChannelInfo,
        selectedChat,
        setIsCreateNewChatOpen,
        setShowPinnedMsg,
        showAddChatBtn,
        showChannelList,
        showSearchChat: headerConfig == null ? void 0 : headerConfig.showSearch,
        title,
        onBack,
        onDeleteTopics,
        onMenuClick,
        onMoreClick,
        onSearchClick,
        onThreadClick
      }
    ),
    /* @__PURE__ */ jsx(
      ChatChannelList,
      {
        channels: channelsToShow,
        handleChatSelect,
        handleToast,
        selectedChannelOrChatId,
        selectedChat,
        showChannelList,
        showCheckBox: headerConfig == null ? void 0 : headerConfig.leftChatPanel,
        showCheckbox,
        onChannelSelect: handleChannelSelect,
        onPinnedChatClick
      }
    )
  ] }) });
};
export {
  TableChatChannelHeader as default
};
