import { TableColumn } from '../model';
import { SortMode, SortOrder } from '@wix/bex-core';

export const aColumn = <T>(
  property: keyof T,
  sortable = false,
  defaultSortOrder?: SortOrder,
  sortMode?: SortMode,
) =>
  ({
    id: property,
    title: property,
    sortable,
    defaultSortOrder,
    sortMode,
    render: (rowData) => rowData[property],
  } as TableColumn<T>);
