import { DataTable, Text } from "react-native-paper";

import { TableSortDirection } from "@/constants/tableSortDirectionEnum";
import { SortableHeader } from "@/components/shared/SortableHeader";

interface UserTableHeaderProps {
  sortColumn: string | null;
  sortDirection: TableSortDirection;
  onSort: (column: string) => void;
  showActions?: boolean;
}

export const UserTableHeader = ({
  sortColumn,
  sortDirection,
  onSort,
}: UserTableHeaderProps) => {
  return (
    <DataTable.Header>
      <SortableHeader
        title="Name"
        column="name"
        sortColumn={sortColumn}
        sortDirection={sortDirection}
        onSort={onSort}
      />
      <SortableHeader
        title="Risk Status"
        column="risk"
        sortColumn={sortColumn}
        sortDirection={sortDirection}
        onSort={onSort}
        centerAlign
        style={{ width: 120 }}
      />
      <SortableHeader
        title="Email"
        column="email"
        sortColumn={sortColumn}
        sortDirection={sortDirection}
        onSort={onSort}
      />
      <SortableHeader
        title="Title"
        column="title"
        sortColumn={sortColumn}
        sortDirection={sortDirection}
        onSort={onSort}
      />
      <DataTable.Title style={{ justifyContent: "center" }}>
        <Text style={{ fontSize: 12 }}>Actions</Text>
      </DataTable.Title>
    </DataTable.Header>
  );
};
