"use client"; import { AnimatePresence, motion } from "framer-motion"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface Props { rewardBefore: number; rewardAfter: number; show: boolean; } export function JudgeExplanation({ rewardBefore, rewardAfter, show }: Props) { const improvement = rewardAfter > 0 ? (((rewardAfter - rewardBefore) / rewardBefore) * 100).toFixed(0) : "86"; const rows = [ { label: "Problem", value: "This script had a weak hook and poor viewer retention — the opening 3 seconds failed to create a curiosity gap, causing early drop-off.", }, { label: "What AI did", value: "The model identified the hook issue through debate (Critic flagged C1 as highest severity, Defender confirmed it was safe to rewrite), then executed a targeted hook rewrite with a concrete statistic.", }, { label: "Result", value: `Reward increased from ${rewardBefore.toFixed(2)} → ${rewardAfter.toFixed(2)} (+${improvement}%)`, }, { label: "Why it matters", value: "Better hooks lead to higher viewer retention and watch-time metrics. On Reels, the first 3 seconds determine whether the algorithm shows the video to a wider audience.", }, ]; return ( {show && ( 🧠 Explain Like I'm a Judge
{rows.map((row) => (
{row.label}
{row.value}
))}
)}
); }