Infrastructure Sync: Initial migration to custom self-hosted Gitea
This commit is contained in:
+14
-10
@@ -3,7 +3,6 @@ import React, { useState, useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
import { getDemoStore } from "@/lib/mockData";
|
||||
|
||||
interface AdminUser {
|
||||
@@ -47,14 +46,25 @@ const INITIAL_ADMIN_USERS: AdminUser[] = [
|
||||
];
|
||||
|
||||
export default function AdminPage() {
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const { data: session, status } = useSession();
|
||||
|
||||
const [users, setUsers] = useState<AdminUser[]>(INITIAL_ADMIN_USERS);
|
||||
const [search, setSearch] = useState("");
|
||||
const [totalTasks, setTotalTasks] = useState(67);
|
||||
const [totalLists, setTotalLists] = useState(9);
|
||||
const [totalTasks] = useState(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
const store = getDemoStore();
|
||||
return store.tasks ? store.tasks.length : 67;
|
||||
}
|
||||
return 67;
|
||||
});
|
||||
const [totalLists] = useState(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
const store = getDemoStore();
|
||||
return store.lists ? store.lists.length : 9;
|
||||
}
|
||||
return 9;
|
||||
});
|
||||
|
||||
// 어드민 권한 판별
|
||||
const userRole = session?.user?.role;
|
||||
@@ -68,12 +78,6 @@ export default function AdminPage() {
|
||||
}
|
||||
}, [status, router]);
|
||||
|
||||
useEffect(() => {
|
||||
const store = getDemoStore();
|
||||
if (store.tasks) setTotalTasks(store.tasks.length);
|
||||
if (store.lists) setTotalLists(store.lists.length);
|
||||
}, []);
|
||||
|
||||
// 로딩 중 스피너
|
||||
if (status === "loading" || status === "unauthenticated") {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user