import { ReactNode } from 'react';
import { Pagination } from './api';

export interface AdminSearchHeaderProps {
  title: string;
  count: number;
  searchTerm: string;
  onSearchChange: (value: string) => void;
  placeholder?: string;
}

export interface Column<T> {
  header: string;
  key?: keyof T;
  cell?: (item: T) => ReactNode;
  align?: 'left' | 'center' | 'right';
}

export interface AdminTableProps<T> {
  columns: Column<T>[];
  data: T[];
  modalDescription?: string;
  modalTitle?: string;
  idField: keyof T;
  isDeleting?: boolean;
  isLoading: boolean;
  onClose: () => void;
  onModalConfirm?: (item: T) => Promise<void>;
  onSearchChange: (value: string) => void;
  searchTerm: string;
  selectedItem?: T;
  title: string;
  pagination?: Pagination;
}
