import { isBreakpointsForPrefixType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { ResponsiveClassStringFormatter } from './responsive-class-string-formatter';
/**
 * A class for format display with BreakpointsForPrefixType to CSS class string
 *
 * @augments ResponsiveClassStringFormatter
 */
class ResponsiveDisplayFormatter extends ResponsiveClassStringFormatter {
  /**
   * Given a margin type, return a string of CSS classes that can be used to apply the margin to an element
   *
   * @param {boolean} input - display or not
   * @param {BreakpointsForPrefixType} [breakpoint] - Breakpoints for prefix of the class
   * @returns {string} - A string of CSS classes.
   */
  formatToken(input, breakpoint) {
    const prefix = isBreakpointsForPrefixType(breakpoint) ? `${breakpoint}:` : '';
    if ((typeof input === 'string' && input === 'false') || input === false) {
      return `${prefix}v-hidden`;
    }
    else if ((typeof input === 'string' && input === 'true') || input === true) {
      return `${prefix}v-block`;
    }
    else {
      LogUtility.warn(`The display value ${input} is invalid, it must be a boolean`);
      return '';
    }
  }
}
export default new ResponsiveDisplayFormatter();
