// PEP-44/46: what the PM needs to review a story — the preview stand of its PR, the diff, // the screenshots taken by CI, and the Gitea issue it came from. import { Eye, FileDiff, CircleDot } from "lucide-react"; import type { ReviewPreview as Preview } from "@peppa/core"; import { PanelSection } from "@/components/ActivityAside"; import { getT } from "@/lib/i18n"; export async function ReviewPreview({ preview }: { preview: Preview }) { if (!preview.previewUrl && !preview.diffUrl && !preview.issueUrl) return null; const t = await getT(); return (
{preview.previewUrl ? ( {t("Посмотреть")}{preview.sha && {preview.sha.slice(0, 7)}} ) : ( preview.diffUrl && {t("Стенда PR ещё нет (деплой превью не настроен или не прошёл).")} )} {preview.diffUrl && ( {t("Дифф")} )} {preview.issueUrl && ( {t("Issue в Gitea")} )}
{preview.releaseId != null && preview.screenshots.length > 0 && (
{preview.screenshots.map((s) => { const src = `/api/releases/${preview.releaseId}/shots/${s.n}`; return ( {/* eslint-disable-next-line @next/next/no-img-element */} {t("Скриншот {s.path} ); })}
)}
); }