import { useTranslation } from "react-i18next"; import { Bug, Sparkles } from "lucide-react"; import { RELEASE_NOTES } from "../lib/releaseNotes"; import { formatDate } from "../lib/format"; import Modal from "./ui/Modal"; // The release date in the UI language — `toLocaleDateString(undefined, …)` formats in the BROWSER's // locale, which put Hungarian-shaped dates in an English release-notes list. Unparseable input falls // back to the raw string (a hand-written note could carry anything). function fmtDate(d: string, lang: string): string { return isNaN(new Date(d).getTime()) ? d : formatDate(d, lang); } // Public release notes (chores are intentionally omitted here). `highlight` rings the // version the user just updated to when opened from the new-version banner. export default function ReleaseNotes({ onClose, highlight, }: { onClose: () => void; highlight?: string; }) { const { t, i18n } = useTranslation(); // Ring the newest note if `highlight` isn't one of the listed versions — e.g. a Vite dev build // where the caller's FRONTEND_VERSION is "dev", or a VERSION bump whose note hasn't landed yet — // so the banner always rings *something* current instead of nothing. const active = RELEASE_NOTES.some((r) => r.version === highlight) ? highlight : RELEASE_NOTES[0]?.version; return (
{RELEASE_NOTES.map((r) => (

v{r.version}

{fmtDate(r.date, i18n.language)} {r.sha && ( {r.sha} )}
{r.summary &&

{r.summary}

} {r.features?.length ? (
{t("about.new")}
    {r.features.map((f, i) => (
  • • {f}
  • ))}
) : null} {r.fixes?.length ? (
{t("about.fixes")}
    {r.fixes.map((f, i) => (
  • • {f}
  • ))}
) : null}
))}
); }