"use client";

import { createContext } from "react";

export type SortDirection = "asc" | "desc";

export interface TableSortContextValue {
  /** BSON field name (snake_case) currently used for `sort_by`. */
  sortKey?: string;
  /** Active `sort_order` value. */
  sortOrder?: SortDirection;
  /** Fired when a sortable header is toggled. */
  onSortChange?: (key: string, order: SortDirection) => void;
}

export const TableSortContext = createContext<TableSortContextValue>({});
