"use client"; import { useEffect, useState, useCallback } from "react"; import Link from "next/link"; import { ChevronLeft, UserCheck } from "lucide-react"; import { Card } from "@/components/ui/Card"; import { Avatar } from "@/components/ui/Avatar"; import { Badge } from "@/components/ui/Badge"; import { EmptyState } from "@/components/ui/EmptyState"; import { FullScreenLoader } from "@/components/ui/FullScreenLoader"; import { ErrorBanner } from "@/components/ui/ErrorBanner"; import { formatApiError } from "@/lib/hooks"; import { calcAge } from "@/lib/utils"; import { PendingUserView, listPendingUsers, photoUrl } from "@/lib/api"; export default function PendingUsersPage() { const [users, setUsers] = useState(null); const [error, setError] = useState(null); const load = useCallback(async () => { setError(null); try { setUsers(await listPendingUsers()); } catch (err) { setError(formatApiError(err)); } }, []); useEffect(() => { // eslint-disable-next-line react-hooks/set-state-in-effect load(); }, [load]); if (error && !users) { return (
); } if (!users) return ; return (

کاربران در انتظار تایید ✅

این کاربرها آنبوردینگ رو کامل کردن و منتظرن پروفایلشون بررسی بشه. قدیمی‌ترین درخواست بالاتره.

{users.length === 0 ? ( } title="کسی منتظر بررسی نیست" description="هر وقت کاربر جدیدی آنبوردینگ رو تموم کنه، اینجا برای بررسی نشون داده می‌شه." /> ) : ( {users.map((u, i) => ( {u.photos.length > 0 ? ( // eslint-disable-next-line @next/next/no-img-element ) : ( )}

{u.first_name || "بدون نام"} {calcAge(u.birth_date) ? `، ${calcAge(u.birth_date)} سال` : ""}

{u.phone}

{u.photos.length === 0 && ( بدون عکس )} {u.gender && ( {u.gender === "male" ? "مرد" : "زن"} )} ))}
)}
); }