feat : add stygian guide

This commit is contained in:
2026-09-29 21:23:18 +07:00 Unverified
parent 1654d3df3a
commit 69a4d34b97
27 changed files with 11196 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"use client";
import { useRouter } from "next/navigation";
import { useTransition } from "react";
import { RefreshCwIcon } from "lucide-react";
import { toast } from "sonner";
import { syncStygianArchiveAction } from "@/app/admin/stygian/actions";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
export function StygianSyncButton() {
const router = useRouter();
const [pending, startTransition] = useTransition();
return (
<Button disabled={pending} onClick={() => startTransition(async () => {
const result = await syncStygianArchiveAction();
if (result.status === "error") toast.error(result.message);
else {
toast.success(`Imported through ${result.imported.at(-1) ?? "none"}; stopped at ${result.stoppedAt}`);
router.refresh();
}
})}>
{pending ? <Spinner data-icon="inline-start" /> : <RefreshCwIcon data-icon="inline-start" />}
Sync archive
</Button>
);
}