You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProfileStats.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import {
  4. ProfileStatsContainer,
  5. ProfileStatsGrid,
  6. StatsItem,
  7. } from "./ProfileStats.styled";
  8. import { useTranslation } from "react-i18next";
  9. const ProfileStats = (props) => {
  10. const { t } = useTranslation();
  11. return (
  12. <ProfileStatsContainer>
  13. <ProfileStatsGrid>
  14. <StatsItem variant="subtitle2">
  15. <b>{props.profile?.statistics?.publishes?.count}</b>
  16. {t("profile.publishes")}
  17. </StatsItem>
  18. <StatsItem variant="subtitle2">
  19. <b>{props.percentOfSucceededExchanges}%</b>
  20. {t("profile.successExchange")}
  21. </StatsItem>
  22. </ProfileStatsGrid>
  23. <ProfileStatsGrid>
  24. <StatsItem variant="subtitle2">
  25. <b>{props.profile?.statistics?.views?.count}</b>
  26. {t("profile.numberOfViews")}
  27. </StatsItem>
  28. <StatsItem variant="subtitle2">
  29. <b>{props.percentOfSucceededExchanges}%</b>
  30. {t("profile.successComunication")}
  31. </StatsItem>
  32. </ProfileStatsGrid>
  33. </ProfileStatsContainer>
  34. );
  35. };
  36. ProfileStats.propTypes = {
  37. profile: PropTypes.object,
  38. percentOfSucceededExchanges: PropTypes.number,
  39. };
  40. export default ProfileStats;