This commit is contained in:
Andrey Sharshov
2025-11-16 18:54:31 +01:00
commit 9487728656
2342 changed files with 62687 additions and 0 deletions

22
utils/parseWinsData.js Normal file
View File

@@ -0,0 +1,22 @@
export const parseWinsData = (winsArray, currency) => {
if (!winsArray || winsArray.length === 0) return ;
const totalWin = winsArray.reduce((total, [_, win]) => {
return total + win;
}, 0);
const totalWinString = currency.getFormattedValue(totalWin);
const wins = winsArray.map(([type, amount, map, lineIndex]) => {
return {
type,
amount,
amountString: currency.getFormattedValue(amount),
lineSlotsIndexMap: map,
lineIndex
}
})
const result = {
totalWin,
totalWinString,
wins
}
return result
}