import React, { useState } from "react"; import { Box } from "@mui/material"; import { Achievement } from "./Achievements"; import { Settings } from "../Settings/Settings"; interface IProps { achievement: Achievement; unlocked: boolean; colorFilters: string; size: string; } export function AchievementIcon({ achievement, unlocked, colorFilters, size }: IProps): JSX.Element { const [imgLoaded, setImgLoaded] = useState(false); const mainColor = unlocked ? Settings.theme.primarydark : Settings.theme.secondarydark; if (!achievement.Icon) return <>; return ( setImgLoaded(true)} alt={achievement.Name} /> ); }