aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/Gaming
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-20 23:28:39 +0900
committernsfisis <nsfisis@gmail.com>2025-03-20 23:28:39 +0900
commit1afd2781818ef5cba0f018811f12cd8653da10b6 (patch)
treef04146c6e8753b07d6d29765f615ab9094cd3f54 /frontend/app/components/Gaming
parenta92aa377d536fe67fa1ff485566da38cf94328bb (diff)
downloadphperkaigi-2025-albatross-1afd2781818ef5cba0f018811f12cd8653da10b6.tar.gz
phperkaigi-2025-albatross-1afd2781818ef5cba0f018811f12cd8653da10b6.tar.zst
phperkaigi-2025-albatross-1afd2781818ef5cba0f018811f12cd8653da10b6.zip
fix(frontend): fix state corruption
Diffstat (limited to 'frontend/app/components/Gaming')
-rw-r--r--frontend/app/components/Gaming/RankingTable.tsx13
1 files changed, 5 insertions, 8 deletions
diff --git a/frontend/app/components/Gaming/RankingTable.tsx b/frontend/app/components/Gaming/RankingTable.tsx
index e712ed9..a1e41f5 100644
--- a/frontend/app/components/Gaming/RankingTable.tsx
+++ b/frontend/app/components/Gaming/RankingTable.tsx
@@ -1,11 +1,6 @@
+import { useAtomValue } from "jotai";
import React from "react";
-import type { components } from "../../api/schema";
-
-type RankingEntry = components["schemas"]["RankingEntry"];
-
-type Props = {
- ranking: RankingEntry[];
-};
+import { rankingAtom } from "../../states/watch";
function TableHeaderCell({ children }: { children: React.ReactNode }) {
return (
@@ -33,7 +28,9 @@ function formatUnixTimestamp(timestamp: number) {
return `${year}-${month}-${day} ${hours}:${minutes}`;
}
-export default function RankingTable({ ranking }: Props) {
+export default function RankingTable() {
+ const ranking = useAtomValue(rankingAtom);
+
return (
<div className="overflow-hidden border-2 border-blue-600 rounded-xl">
<table className="min-w-full divide-y divide-gray-400 border-collapse">