import { isGridRowsType, isBreakpointsForPrefixType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
import { GridRows } from '../../../constants/tokens/tailwind.extend';
/**
 * A class for format GridRowsType with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveGridRowsFormatter extends ResponsiveClassStringFormatter {
  /**
   * This function takes a GridRowsType and a breakpoint and returns CSS class string.
   *
   * @param {GridRowsType} input - GridRowsType input
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} - A string.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if (isGridRowsType(input)) {
      return `${prefix}v-grid-rows-${input}`;
    }
    else {
      LogUtility.warn(`The row value ${input} is invalid, it must be a value of: `, GridRows);
      return '';
    }
  }
}
export default new ResponsiveGridRowsFormatter();
