// PEP-120: the story page for a product manager — one card: what is happening now and // «шаг N из M», the link to look at the result, what is needed from them, what comes next, // «Принять» and «Поправить». Everything of a developer stays under «Подробнее» on the page. import { Check, Eye, Pencil, Send } from "lucide-react"; import type { Question, ReviewPreview, StoryProductView } from "@peppa/core"; import { Hidden, QuestionCard } from "@/components/cards"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/input"; import { getT } from "@/lib/i18n"; import { cn } from "@/lib/utils"; import { acceptStoryAction, fixStoryAction } from "@/app/(app)/actions"; export async function StoryProduct({ view, taskKey, taskStatus, preview, questions, back, productUrl = null }: { view: StoryProductView; taskKey: string; taskStatus: string; preview: ReviewPreview; questions: Question[]; back: string; /** PEP-145: the project's product — where an accepted story is seen. */ productUrl?: string | null }) { const t = await getT(); const pct = view.step ? Math.round(((view.step.n - 1) / view.step.m) * 100) : 0; return (

{t.text(view.now)}

{view.step && (
{t("Шаг {n} из {m}", { n: view.step.n, m: view.step.m })}
{view.stepText &&

{t("Сейчас: {step}", { step: view.stepText })}

}
)}
{!preview.previewUrl && productUrl && taskStatus === "done" && (

{t("Откроется продукт проекта — в нём уже есть эта задача.")}

)} {preview.previewUrl && (

{t("Откроется версия для проверки — её видите только вы.")}

{preview.releaseId != null && preview.screenshots.length > 0 && (
{preview.screenshots.slice(0, 3).map((s) => { const src = `/api/releases/${preview.releaseId}/shots/${s.n}`; return ( {/* eslint-disable-next-line @next/next/no-img-element */} {t("Снимок ); })}
)}
)}
{t("Что нужно от вас")}
{view.need ? t.text(view.need) : t("От вас сейчас ничего не нужно.")}
{t("Что дальше")}
{t.text(view.next)}
{questions.map((q) => ( ))} {(view.canAccept || view.canFix) && (
{view.canAccept && (
)} {view.canFix && (
{t("Поправить")}