import type { DataTableColumn } from './types'

export function resolveCellValue<T>(row: T, col: DataTableColumn<T>): unknown {
  if (col.accessor) return col.accessor(row)
  if (col.key in (row as Record<string, unknown>)) {
    return (row as Record<string, unknown>)[col.key]
  }
  return undefined
}
