import type {
  SpreadsheetColumnConfig,
  SpreadsheetTextAlign,
} from '../types';

export function resolveColumnTextAlign(
  colCfg: SpreadsheetColumnConfig | undefined,
  defaultAlign: SpreadsheetTextAlign = 'left',
): SpreadsheetTextAlign {
  const a = colCfg?.textAlign;
  if (!a || a === 'inherit') return defaultAlign;
  return a;
}
