+ {reportDone ? (
+
+ {t("report.done")}
+
+ ) : !reportOpen ? (
+
+ ) : (
+
+
{t("report.title")}
+
+ {([
+ ["nudity", "🔞", t("report.nudity")],
+ ["insult", "💬", t("report.insult")],
+ ["other", "⚠️", t("report.other")],
+ ] as const).map(([reason, icon, label]) => (
+
+ ))}
+
+
+
+ )}
+
+ )}
+
{/* stats */}
diff --git a/src/components/screens/ChatScreen.tsx b/src/components/screens/ChatScreen.tsx
index 2db26a4..bb5b72b 100644
--- a/src/components/screens/ChatScreen.tsx
+++ b/src/components/screens/ChatScreen.tsx
@@ -1,12 +1,14 @@
"use client";
-import { ChevronLeft, ChevronRight, MessageCircle, Send, Smile } from "lucide-react";
+import { ChevronLeft, ChevronRight, Flag, MessageCircle, Send, Smile } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { useOnlineStore } from "@/lib/online-store";
import { useSessionStore } from "@/lib/session-store";
import { useUIStore } from "@/lib/ui-store";
import { useI18n } from "@/lib/i18n";
import { sound } from "@/lib/sound";
+import { getService } from "@/lib/online/service";
+import { pushNotification } from "@/lib/notification-store";
import { ownedReactions } from "@/lib/online/gamification";
import { avatarEmoji } from "@/lib/online/types";
import { cn } from "@/lib/cn";
@@ -23,6 +25,7 @@ export function ChatScreen() {
const viewProfile = useUIStore((s) => s.viewProfile);
const [text, setText] = useState("");
const [showEmoji, setShowEmoji] = useState(false);
+ const [reported, setReported] = useState(false);
const emojis = profile ? ownedReactions(profile) : [];
const endRef = useRef
(null);
const prevLen = useRef(0);
@@ -58,6 +61,20 @@ export function ChatScreen() {
await sendChat(e);
};
+ const reportFriend = async () => {
+ if (reported || !friend) return;
+ setReported(true);
+ await getService().reportUser(friend.id, "insult");
+ pushNotification({
+ kind: "system",
+ titleFa: "گزارش ثبت شد",
+ titleEn: "Report submitted",
+ bodyFa: "از کمک شما برای حفظ محیط سالم ممنونیم.",
+ bodyEn: "Thanks for helping keep the game friendly.",
+ icon: "🚩",
+ });
+ };
+
return (
@@ -86,6 +103,20 @@ export function ChatScreen() {
+
+ {/* report this player for insulting chat */}
+