import React from "react";
import { Filters } from "neetofilters";

type ColumnData = {
  dataIndex: string;
  title: string;
  key: string;
};

type DownloadButtonProps = {
  count?: number;
  onClick: () => void;
  "data-testid"?: string;
  tooltipProps?: {
    content?: string;
    [key: string]: any;
  };
};

type DataProps = {
  totalCount?: number;
};

type ColumnsButtonProps = {
  actionBlock?: React.ReactNode;
  checkboxProps?: object;
  columnData?: ColumnData[];
  isSearchable?: boolean;
  tableKey?: string;
  noColumnMessage?: string;
  searchProps?: object;
};

interface RightBlockComposition {
  RightBlock: React.FC<{
    downloadButtonProps?: DownloadButtonProps;
    filterProps?: React.ComponentProps<typeof Filters>;
    columnsButtonProps?: ColumnsButtonProps;
    dataProps?: DataProps;
  }>;
}

const SubHeader: React.FC<{
  className?: string;
  "data-testid"?: string;
  leftActionBlock?: React.ReactNode;
  rightActionBlock?: React.ReactNode;
}> &
  RightBlockComposition;

export default SubHeader;
