lint
This commit is contained in:
@@ -15,8 +15,6 @@ import {
|
||||
import { useUserStore } from "@/store/useUserStore";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
// import { useUserMe } from "@/hooks/user/use-user-me";
|
||||
// import { toast } from "sonner";
|
||||
|
||||
export default function ConsoleMenuLayout({
|
||||
children,
|
||||
@@ -30,7 +28,7 @@ export default function ConsoleMenuLayout({
|
||||
if (userStore.initialized && !userStore.user) {
|
||||
router.replace('/console/login')
|
||||
}
|
||||
}, [userStore])
|
||||
}, [userStore, router])
|
||||
|
||||
return (
|
||||
<SidebarProvider>
|
||||
|
||||
@@ -3,17 +3,15 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Field, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet } from "@/components/ui/field";
|
||||
import { useUserStore } from "@/store/useUserStore";
|
||||
import { Checkbox } from "@radix-ui/react-checkbox";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCaption,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table"
|
||||
import { ReactElement, useMemo, useState } from "react";
|
||||
import { ReactElement, useState } from "react";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
|
||||
@@ -27,6 +27,7 @@ import { AlertCircle } from "lucide-react";
|
||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { AdminAPI } from "@/lib/api/client";
|
||||
import { UserEntity } from "@/lib/api/endpoints/admin.client";
|
||||
|
||||
export function UserInfoEditor({
|
||||
onClose,
|
||||
@@ -35,7 +36,7 @@ export function UserInfoEditor({
|
||||
userId,
|
||||
}: {
|
||||
onClose: () => void,
|
||||
onUserUpdate: (user: User) => void,
|
||||
onUserUpdate: (user: UserEntity) => void,
|
||||
onUserSoftDelete: (userId: string) => void,
|
||||
userId: string
|
||||
}) {
|
||||
|
||||
@@ -6,19 +6,19 @@ import { TooltipContent, TooltipProvider, TooltipTrigger, Tooltip } from "@/comp
|
||||
import { useUserList } from "@/hooks/admin/user/use-user-list";
|
||||
import { useState } from "react";
|
||||
import { UserInfoEditor } from "./components/user-info-editor";
|
||||
import { User } from "@/lib/types/user";
|
||||
import { CreateUserEditor } from "./components/create-user-editor";
|
||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
|
||||
import { toast } from "sonner";
|
||||
import { ApiError } from "next/dist/server/api-utils";
|
||||
import { AdminAPI } from "@/lib/api/client";
|
||||
import { UserEntity } from "@/lib/api/endpoints/admin.client";
|
||||
|
||||
|
||||
export default function Page() {
|
||||
const { users, isLoading, error, mutate, refresh } = useUserList();
|
||||
const [editorUserId, setEditorUserId] = useState("");
|
||||
|
||||
const handleUserUpdateLocal = async (newUser: User) => {
|
||||
const handleUserUpdateLocal = async (newUser: UserEntity) => {
|
||||
await mutate(
|
||||
(data) => {
|
||||
if (!data) return data;
|
||||
|
||||
Reference in New Issue
Block a user