import React from "react"; import { Box, Typography } from "@mui/material"; import { Achievement } from "./Achievements"; import { Settings } from "../Settings/Settings" import { AchievementIcon } from "./AchievementIcon"; interface IProps { achievement: Achievement; unlockedOn?: number; cssFiltersUnlocked: string; cssFiltersLocked: string; } export function AchievementEntry({ achievement, unlockedOn, cssFiltersUnlocked, cssFiltersLocked }: IProps): JSX.Element { if (!achievement) return <>; const isUnlocked = !!unlockedOn; const mainColor = isUnlocked ? Settings.theme.primary : Settings.theme.secondarylight; let achievedOn = ''; if (unlockedOn) { achievedOn = new Date(unlockedOn).toLocaleString(); } return ( {achievement.Name} {achievement.Description} {isUnlocked && ( Acquired on {achievedOn} )} ); }