+
+
+
{t("requirements")}
diff --git a/src/renderer/pages/game-details/how-long-to-beat-section.tsx b/src/renderer/pages/game-details/how-long-to-beat-section.tsx
new file mode 100644
index 00000000..275f837e
--- /dev/null
+++ b/src/renderer/pages/game-details/how-long-to-beat-section.tsx
@@ -0,0 +1,69 @@
+import Skeleton, { SkeletonTheme } from "react-loading-skeleton";
+import type { HowLongToBeatCategory } from "@types";
+import { useTranslation } from "react-i18next";
+import { vars } from "@renderer/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
+
+
+
+
+ );
+}
diff --git a/src/renderer/pages/game-details/repacks-modal.tsx b/src/renderer/pages/game-details/repacks-modal.tsx
index fcefe674..421163d1 100644
--- a/src/renderer/pages/game-details/repacks-modal.tsx
+++ b/src/renderer/pages/game-details/repacks-modal.tsx
@@ -56,8 +56,8 @@ export function RepacksModal({
gameDetails.repacks.filter((repack) =>
repack.title
.toLowerCase()
- .includes(event.target.value.toLocaleLowerCase())
- )
+ .includes(event.target.value.toLocaleLowerCase()),
+ ),
);
};
diff --git a/src/types/index.ts b/src/types/index.ts
index 42fb7850..2ab27f9a 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -102,3 +102,9 @@ export interface UserPreferences {
downloadNotificationsEnabled: boolean;
repackUpdatesNotificationsEnabled: boolean;
}
+
+export interface HowLongToBeatCategory {
+ title: string;
+ duration: string;
+ accuracy: string;
+}