import Link from "next/link"; import { FEEDBACK_ADMIN_STATUS, FEEDBACK_KIND, FEEDBACK_SIZE, FEEDBACK_USER_STATUS, feedbackTitle, type FeedbackView } from "@peppa/core"; import { Hidden } from "@/components/cards"; import { ago, Disclosure } from "@/components/common"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Card } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { getT } from "@/lib/i18n"; import { fixFeedbackAction, linkFeedbackAction, rejectFeedbackAction } from "@/app/(app)/actions"; const TONE = { received: "muted", analyzed: "info", planned: "info", fixed: "ok", rejected: "warn" } as const; function Shots({ f, label }: { f: FeedbackView; label: (n: number) => string }) { if (!f.screenshots.length) return null; return (
); } /** PEP-143: the author's own report — what they wrote, where it stands, what they were answered. */ export async function MyFeedbackCard({ f }: { f: FeedbackView }) { const t = await getT(); return ({f.text}
}{t("Исправили. Спасибо, что сообщили.")}
} {f.status === "rejected" &&{f.rejectReason ? t("Решили пока не исправлять. Причина: {reason}", { reason: f.rejectReason }) : t("Решили пока не исправлять.")}
}{f.text}
:{t("Скриншот без подписи")}
}{t("Суть")}: {a.summary}
{a.cause &&{t("Вероятная причина")}: {a.cause}
} {!a.confident &&{t("Агент не уверен в разборе — проверьте сами.")}
} {a.options.map((o, i) => ({o.what}
{o.pros &&➕ {o.pros}
} {o.cons &&➖ {o.cons}
} {open && ( )}{f.analysisError ? t("Разбора нет: агент не смог ответить.") : t("Разбора нет.")}
)} {f.status === "received" &&{t("Агент обратной связи разбирает обращение…")}
} {f.taskKey && ({t("Задача")}: {f.taskKey} {f.taskTitle}
)} {f.status === "rejected" &&{f.rejectReason ? t("Не исправляем. Причина: {reason}", { reason: f.rejectReason }) : t("Не исправляем.")}
} {open && (