import Skeleton, { SkeletonTheme } from "react-loading-skeleton"; import type { HowLongToBeatCategory } from "@types"; import { useTranslation } from "react-i18next"; import { vars } from "../../theme.css"; import * as styles from "./game-details.css"; const durationTranslation: Record = { Hours: "hours", Mins: "minutes", }; export interface HowLongToBeatSectionProps { howLongToBeatData: HowLongToBeatCategory[] | null; isLoading: boolean; } export function HowLongToBeatSection({ howLongToBeatData, isLoading, }: HowLongToBeatSectionProps) { const { t } = useTranslation("game_details"); const getDuration = (duration: string) => { const [value, unit] = duration.split(" "); return `${value} ${t(durationTranslation[unit])}`; }; if (!howLongToBeatData && !isLoading) return null; return (

HowLongToBeat

); }