(stats)
| 117 | }; |
| 118 | |
| 119 | export const getClientStats = (stats) => { |
| 120 | return Object.values(stats).reduce((acc, ch) => { |
| 121 | if (ch.clients && Array.isArray(ch.clients)) { |
| 122 | return acc.concat( |
| 123 | ch.clients.map((client) => ({ |
| 124 | ...client, |
| 125 | channel: ch, |
| 126 | })) |
| 127 | ); |
| 128 | } |
| 129 | return acc; |
| 130 | }, []); |
| 131 | }; |
| 132 | |
| 133 | export const getStatsByChannelId = ( |
| 134 | channelStats, |