feat: implement user verification and rejection functionality with improved error handling

This commit is contained in:
2025-07-13 22:51:46 +05:00
parent 5809e26593
commit 255c03ae6a
7 changed files with 315 additions and 220 deletions

View File

@ -1,4 +1,7 @@
"use client";
import { Check, CheckCheck } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
import { VerifyUser } from "@/actions/user-actions";
import {
AlertDialog,
@ -12,12 +15,9 @@ import {
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import type { User } from "@/lib/types/user";
import { Check, CheckCheck } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
import type { UserProfile } from "@/lib/types/user";
export function UserVerifyDialog({ user }: { user: User }) {
export function UserVerifyDialog({ user }: { user: UserProfile }) {
const userId = user.id;
const [disabled, setDisabled] = useState(false);
return (
@ -33,7 +33,7 @@ export function UserVerifyDialog({ user }: { user: User }) {
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
<AlertDialogTitle className="text-muted-foreground">Verify User</AlertDialogTitle>
<AlertDialogDescription>
Are you sure you want to verify the following user?
<span className="inline-block my-4">