import classnames from 'classnames';
import { getModifierClasses } from '../../../helpers';

export const getColumnClasses = ({
  align,
  className,
  defaultClassName,
  grow,
  isLink,
  isDimmed,
  isIndex,
  level,
  size,
}) => classnames(
  defaultClassName,
  getModifierClasses({
    prefix: 'align',
    value: align,
    isResponsive: true,
    allowed: ['left', 'center', 'right', 'top', 'middle', 'bottom'],
  }),
  getModifierClasses({
    value: grow,
    prefix: 'grow',
    isResponsive: true,
    allowed: ['1', '2', '3', '4', '5', '6', '7', '8'],
  }),
  getModifierClasses({
    value: level,
    prefix: 'level',
    allowed: ['primary', 'secondary'],
  }),
  getModifierClasses({
    value: size,
    prefix: 'size',
    isResponsive: true,
    allowed: ['xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
  }),
  {
    'as--link': isLink,
    'as--dimmed': isDimmed,
    'as--index': isIndex,
  },
  className,
);
