From 7cf6c78c775b63efe18584a00db811adf3298a84 Mon Sep 17 00:00:00 2001 From: mobiniqow Date: Wed, 16 Sep 2026 09:23:11 +0330 Subject: [PATCH] Add structured rejection reasons (checkable presets + free text) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reject modal now offers 5 common rejection reasons as tickable options (no photo, incomplete info, looks fake/bot, inappropriate photos, contact info in profile), combined with an optional free-text note. The combined string is sent as the existing reason field — no backend change needed. Co-Authored-By: Claude Sonnet 5 --- src/app/(dashboard)/users/[id]/page.tsx | 75 +++++++++++++++++++++---- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/src/app/(dashboard)/users/[id]/page.tsx b/src/app/(dashboard)/users/[id]/page.tsx index 571d748..1ecd925 100644 --- a/src/app/(dashboard)/users/[id]/page.tsx +++ b/src/app/(dashboard)/users/[id]/page.tsx @@ -13,6 +13,7 @@ import { Heart, Sparkles, Search, + Check, } from "lucide-react"; import { Card } from "@/components/ui/Card"; import { Avatar } from "@/components/ui/Avatar"; @@ -260,6 +261,15 @@ export default function UserReviewPage() { ); } +// دلایل رایج رد پروفایل — ادمین تیک می‌زنه، متن نهایی خودکار برای کاربر ساخته می‌شه +const COMMON_REASONS = [ + "عکس پروفایل نداره یا واضح نیست", + "اطلاعات پروفایل ناقصه", + "پروفایل به نظر جعلی یا ربات میاد", + "محتوای عکس‌ها نامناسبه", + "توی پروفایل شماره تماس یا لینک گذاشته", +]; + function RejectModal({ open, onClose, @@ -271,14 +281,25 @@ function RejectModal({ onConfirm: (reason: string) => void; loading: boolean; }) { - const [reason, setReason] = useState(""); + const [selected, setSelected] = useState([]); + const [extra, setExtra] = useState(""); useEffect(() => { - // eslint-disable-next-line react-hooks/set-state-in-effect - if (open) setReason(""); + if (open) { + // eslint-disable-next-line react-hooks/set-state-in-effect + setSelected([]); + setExtra(""); + } }, [open]); - const valid = reason.trim().length >= 3; + function toggle(text: string) { + setSelected((prev) => + prev.includes(text) ? prev.filter((t) => t !== text) : [...prev, text] + ); + } + + const finalReason = [...selected, extra.trim()].filter(Boolean).join("؛ "); + const valid = finalReason.length >= 3; return ( @@ -287,15 +308,49 @@ function RejectModal({ +
+ {COMMON_REASONS.map((text) => { + const checked = selected.includes(text); + return ( + + ); + })} +
+ + +
+