import { isBreakpointsTokenType } from '../../types/type-guard';
/**
 * Input a breakpoint, return the responsive style classes of the breakpoint
 *
 * @param {BreakpointsTokenType} breakpoint - The breakpoint as an input
 * @param {string} className - The input class that will be formatted to responsive classes
 * @returns {string} The style classes for the breakpoint
 */
export const generateResponsiveClass = (breakpoint, className) => {
  return breakpoint && isBreakpointsTokenType(breakpoint) ? `v-hidden ${breakpoint}:${className}` : '';
};
/**
 * Input an align, return the style class of the alignment
 *
 * @param {ColumnAlignType} align - The align type
 * @returns {string} The alignment style classes
 */
export const generateTextAlignClass = (align) => {
  let alignClass;
  switch (align) {
    case 'center':
      alignClass = 'v-text-center';
      break;
    case 'left':
      alignClass = 'v-text-left';
      break;
    case 'right':
      alignClass = 'v-text-right';
      break;
    default:
      alignClass = '';
  }
  return alignClass;
};
/**
 * The function `generateColSpan` calculates the column span based on the length of columns and whether multiple selection is enabled.
 *
 * @param {number} columnLength - The number of columns in a table or grid.
 * @param {boolean} withMultipleSelection - A boolean value indicating whether the table has a column for multiple selection.
 * @returns {number} the value of `columnLength` plus 2 if `withMultipleSelection` is true, or plus 1 if `withMultipleSelection` is false.
 */
export const generateColSpan = (columnLength, withMultipleSelection) => {
  return columnLength + (withMultipleSelection ? 2 : 1);
};
