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