"use client"; import { motion } from "framer-motion"; import { useTranslations } from "@/lib/i18n"; import { Card } from "@/components/ui/card"; interface WhatsNewProps { diff: { from: string; to: string; newClasses: string[]; newFunctions: string[]; newTools: string[]; locDelta: number; } | null; } export function WhatsNew({ diff }: WhatsNewProps) { const t = useTranslations("version"); const td = useTranslations("diff"); if (!diff) { return null; } const hasContent = diff.newClasses.length > 0 || diff.newTools.length > 0 || diff.newFunctions.length > 0 || diff.locDelta !== 0; if (!hasContent) { return null; } return (

{t("whats_new")}

{diff.newClasses.length > 0 && (

{td("new_classes")}

{diff.newClasses.map((cls) => (
{cls}
))}
)} {diff.newTools.length > 0 && (

{td("new_tools")}

{diff.newTools.map((tool) => ( {tool} ))}
)} {diff.newFunctions.length > 0 && (

{td("new_functions")}

    {diff.newFunctions.map((fn) => (
  • def{" "} {fn}()
  • ))}
)} {diff.locDelta !== 0 && (

{td("loc_delta")}

+{diff.locDelta} lines

)}
); }