| if (profile?.statistics?.exchanges?.succeededExchanges === 0) { | if (profile?.statistics?.exchanges?.succeededExchanges === 0) { | ||||
| percentOfSucceededExchanges = 0; | percentOfSucceededExchanges = 0; | ||||
| } else { | } else { | ||||
| percentOfSucceededExchanges = Math.ceil( | |||||
| ((profile?.statistics?.exchanges?.succeededExchanges + | |||||
| profile?.statistics?.exchanges?.failedExchanges) / | |||||
| profile?.statistics?.exchanges?.succeededExchanges) * | |||||
| 100 | |||||
| percentOfSucceededExchanges = Math.round( | |||||
| profile.statistics.exchanges.succeededExchanges / | |||||
| ((profile.statistics.exchanges.succeededExchanges + | |||||
| profile.statistics.exchanges.failedExchanges) / | |||||
| 100) | |||||
| ); | ); | ||||
| } | } | ||||
| if (profile?.statistics?.exchanges?.succeededCommunication === 0) { | if (profile?.statistics?.exchanges?.succeededCommunication === 0) { | ||||
| percentOfSucceededCommunication = 0; | percentOfSucceededCommunication = 0; | ||||
| } else { | } else { | ||||
| percentOfSucceededCommunication = Math.ceil( | |||||
| ((profile?.statistics?.exchanges?.succeededCommunication + | |||||
| profile?.statistics?.exchanges?.failedCommunication) / | |||||
| profile?.statistics?.exchanges?.succeededCommunication) * | |||||
| 100 | |||||
| percentOfSucceededCommunication = Math.round( | |||||
| profile.statistics.exchanges.succeededCommunication / | |||||
| ((profile.statistics.exchanges.succeededCommunication + | |||||
| profile.statistics.exchanges.failedCommunication) / | |||||
| 100) | |||||
| ); | ); | ||||
| } | } | ||||
| if (offer?.user?.statistics?.exchanges?.succeededExchanges === 0) { | if (offer?.user?.statistics?.exchanges?.succeededExchanges === 0) { | ||||
| percentOfSucceededExchanges = 0; | percentOfSucceededExchanges = 0; | ||||
| } else { | } else { | ||||
| percentOfSucceededExchanges = Math.ceil( | |||||
| ((offer?.user?.statistics?.exchanges?.succeededExchanges + | |||||
| offer?.user?.statistics?.exchanges?.failedExchanges) / | |||||
| offer?.user?.statistics?.exchanges?.succeededExchanges) * | |||||
| 100 | |||||
| percentOfSucceededExchanges = Math.round( | |||||
| offer?.user?.statistics.exchanges.succeededExchanges / | |||||
| ((offer?.user?.statistics.exchanges.succeededExchanges + | |||||
| offer?.user?.statistics.exchanges.failedExchanges) / | |||||
| 100) | |||||
| ); | ); | ||||
| } | } | ||||
| if (offer?.user?.statistics?.exchanges?.succeededCommunication === 0) { | if (offer?.user?.statistics?.exchanges?.succeededCommunication === 0) { | ||||
| percentOfSucceededCommunication = 0; | percentOfSucceededCommunication = 0; | ||||
| } else { | } else { | ||||
| percentOfSucceededCommunication = Math.ceil( | |||||
| ((offer?.user?.statistics?.exchanges?.succeededCommunication + | |||||
| offer?.user?.statistics?.exchanges?.failedCommunication) / | |||||
| offer?.user?.statistics?.exchanges?.succeededCommunication) * | |||||
| 100 | |||||
| percentOfSucceededCommunication = Math.round( | |||||
| offer?.user?.statistics.exchanges.succeededCommunication / | |||||
| ((offer?.user?.statistics.exchanges.succeededCommunication + | |||||
| offer?.user?.statistics.exchanges.failedCommunication) / | |||||
| 100) | |||||
| ); | ); | ||||
| } | } | ||||
| css` | css` | ||||
| color: ${selectedTheme.colors.primaryText}; | color: ${selectedTheme.colors.primaryText}; | ||||
| `} | `} | ||||
| `; | |||||
| `; |