/**
 * Helper class for font
 */
import _ from 'lodash';

// use post script names for font families
const Quicksand: any = {
  '100': { fontFamily: 'Quicksand-Light' },
  '200': { fontFamily: 'Quicksand-Regular' },
  '300': { fontFamily: 'Quicksand-Medium' },
  '400': { fontFamily: 'Quicksand-SemiBold' },
  '500': { fontFamily: 'Quicksand-Bold' }
};

const FONTS: any = {
  Quicksand
};

/**
 * Helper class for cross-platform font styles
 */
class FontHelper {
  static font(fontParams: {
    fontFamily?: any;
    fontStyle?: any;
    fontWeight?: string;
  }) {
    const fontFamily = fontParams.fontFamily || 'Quicksand';
    const fontWeight = fontParams.fontWeight || '300';
    const fontStyle = fontParams.fontStyle || '';

    return {
      ..._.omit(fontParams, [fontFamily, fontFamily, fontStyle]),
      ...FONTS[fontFamily][fontWeight + fontStyle]
    };
  }
}

export default FontHelper;
