import { Card, CardContent, CardMedia, LinearProgress, LinearProgressProps, Typography } from "@mui/material"; import Box from "@mui/system/Box"; import Grid from "@mui/system/Grid"; import { LoadingPlaceholder } from "@/core/ui/LoadingWidget/LoadingWidget"; import { WgerContainerFullWidth } from "@/core/ui/Widgets/Container"; import { UserTrophyProgression } from "@/components/Trophies/models/userTrophyProgression"; import { useUserTrophyProgressionQuery } from "@/components/Trophies/queries/trophies"; import React from "react"; import { useTranslation } from "react-i18next"; export const TrophiesDetail = () => { const [t] = useTranslation(); const planQuery = useUserTrophyProgressionQuery(); if (planQuery.isLoading) { return ; } return {planQuery.data!.map((trophyProgression) => ( ))} ; }; function TrophyProgressCard(props: { trophyProgression: UserTrophyProgression }) { return {props.trophyProgression.trophy.name} {(props.trophyProgression.trophy.isProgressive && !props.trophyProgression.isEarned) && } {props.trophyProgression.progressDisplay} {props.trophyProgression.trophy.description} ; } const LinearProgressWithLabel = (props: LinearProgressProps & { value: number, progressLabel?: string | null }) => { // Extract custom prop so it doesn't get passed to the progress bar via the spread operator const { progressLabel, ...linearProps } = props; return ( {progressLabel ?? `${Math.round(props.value)}%`} ); };