UNPKG

@applicaster/zapp-react-native-utils

Version:

Applicaster Zapp React Native utilities package

18 lines (14 loc) 544 B
import { take, map, trim } from "lodash"; import { selectActionButtons } from "../conf/player/selectors"; /** * Returns the first two action buttons from the configuration. * @param {Object} configuration - The player configuration object. * @returns {Array} An array containing the first two action buttons. */ export const getPlayerActionButtons = (configuration: any) => { const buttonsString = selectActionButtons(configuration); if (!buttonsString) { return []; } return take(map(buttonsString.split(","), trim), 2); };