badges
This commit is contained in:
@@ -4,10 +4,23 @@ import {
|
||||
DatabaseIcon,
|
||||
TreeStructureIcon,
|
||||
TrophyIcon,
|
||||
MedalIcon,
|
||||
} from "@phosphor-icons/react";
|
||||
import ListButton from "@/components/list-button";
|
||||
import { migrateBadgeProgress } from "@/features/badges/server";
|
||||
import { useState } from "react";
|
||||
|
||||
const AdminPage = () => {
|
||||
const [isMigrating, setIsMigrating] = useState(false);
|
||||
|
||||
const handleMigrateBadges = async () => {
|
||||
if (isMigrating) return;
|
||||
|
||||
setIsMigrating(true);
|
||||
await migrateBadgeProgress();
|
||||
setIsMigrating(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<List p="0">
|
||||
<ListLink
|
||||
@@ -15,6 +28,12 @@ const AdminPage = () => {
|
||||
Icon={TrophyIcon}
|
||||
to="/admin/tournaments"
|
||||
/>
|
||||
<ListButton
|
||||
label="Migrate Badge Progress"
|
||||
Icon={MedalIcon}
|
||||
onClick={handleMigrateBadges}
|
||||
loading={isMigrating}
|
||||
/>
|
||||
<ListButton
|
||||
label="Open Pocketbase"
|
||||
Icon={DatabaseIcon}
|
||||
|
||||
Reference in New Issue
Block a user