"use client";

import clsx from "clsx";

import { ChatItemsListHeader, ViewAllProps } from "..";

import styles from "./ChatItemsList.module.scss";

interface ChatItemsListProps {
  className?: string;
  children: React.ReactNode;
  title: string;
  viewAllProps: ViewAllProps;
  isVisibleViewAll?: boolean;
}

export default function ChatItemsList({
  className,
  children,
  title,
  viewAllProps,
  isVisibleViewAll = true,
}: ChatItemsListProps) {
  return (
    <div className={clsx(styles.chatItemsList, className)}>
      <ChatItemsListHeader
        title={title}
        viewAllProps={viewAllProps}
        isVisibleViewAll={isVisibleViewAll}
      />
      {children}
    </div>
  );
}
