type LegacyTableColumn = { id?: string key?: string label?: unknown header?: unknown accessorKey?: string [key: string]: unknown } export const normalizeTableColumns = (columns: LegacyTableColumn[] = []) => { return columns.map((column, index) => { const accessorKey = typeof column.accessorKey === 'string' ? column.accessorKey : typeof column.key === 'string' ? column.key : undefined const header = column.header ?? column.label ?? accessorKey ?? `column_${index}` const id = column.id ?? accessorKey ?? (typeof header === 'string' ? header : `column_${index}`) return { ...column, id, accessorKey, header } }) }