import { LoadingPlaceholder } from "@/core/ui/LoadingWidget/LoadingWidget"; import { UserTrophy, useUserTrophiesQuery } from "@/components/Trophies"; import { makeLink, WgerLink } from "@/core/lib/url"; import { Button, Card, CardContent, CardHeader, CardMedia, Tooltip, Typography, } from "@mui/material"; import Box from "@mui/system/Box"; import Stack from "@mui/system/Stack"; import React from "react"; import { useTranslation } from "react-i18next"; import { DashboardCard } from "./DashboardCard"; export const TrophiesCard = () => { const trophiesQuery = useUserTrophiesQuery(); if (trophiesQuery.isLoading) { return ; } // PR trophies have their own treatment and are kept out of this widget const trophies = (trophiesQuery.data ?? []).filter((userTrophy) => userTrophy.trophy.type !== 'pr'); return trophies.length > 0 ? : ; }; function TrophiesCardContent(props: { trophies: UserTrophy[] }) { const { t, i18n } = useTranslation(); const tooltipWidget = (tooltip: string) => {tooltip} ; return ( } > {props.trophies.map((userTrophy) => ( {userTrophy.trophy.name} ))} ); } export const EmptyTrophiesCardContent = () => { const [t] = useTranslation(); return (<> {t('nothingHereYet')} ); };