UNPKG

@janiscommerce/ui-native

Version:
8 lines (7 loc) 310 B
export const formatPlaceholderMulti = (options, optionsText) => { if (!options.length) { return ''; } const validOptionText = `(+${options.length - 1}${optionsText ? ` ${optionsText}` : ''})`; return options.length > 1 ? `${options[0].label} ${validOptionText}` : options[0].label; };