import { TableControls } from "@/components/shared/TableControls";
import { AdminControls } from "@/components/features/admins/AdminControls";

interface AdminTableControlsProps {
  searchQuery: string;
  menuVisible: boolean;
  menuAnchor: { x: number; y: number };
  onSearch: (query: string) => void;
  onMenuDismiss: () => void;
  onItemsPerPageChange: (value: number) => void;
  onAddAdmin?: () => void;
  itemsPerPage?: number;
}

export const AdminAccountsTableControls = ({
  searchQuery,
  menuVisible,
  menuAnchor,
  onSearch,
  onMenuDismiss,
  onItemsPerPageChange,
  onAddAdmin = () => {},
  itemsPerPage = 25,
}: AdminTableControlsProps) => {
  const renderActionButtons = () => {
    return <AdminControls onAddAdmin={onAddAdmin} />;
  };

  return (
    <TableControls
      searchQuery={searchQuery}
      menuVisible={menuVisible}
      menuAnchor={menuAnchor}
      searchPlaceholder="Search admins"
      onSearch={onSearch}
      onMenuDismiss={onMenuDismiss}
      onItemsPerPageChange={onItemsPerPageChange}
      itemsPerPage={itemsPerPage}
      renderActionButtons={renderActionButtons}
      itemsPerPageMenuOptions={[5, 10, 25]}
    />
  );
};
