"use client" import { Link, useNavigate } from "react-router" import { PrimaryPageTemplate } from "@/components/templates/primary-page-template" import { useWhatsNewSeen } from "@/components/product-home/product-home-parts" import { useWhatsNewTimelineUpdates } from "@/components/whats-new-sheet-context" import { Button } from "@/components/ui/button" import { useProductSwitch } from "@/contexts/product-route-sync" import { useProductDashboardHref } from "@/contexts/product-route-sync" import { LEO_WINDOW_COVER_IMAGE, LEO_WINDOW_PREVIEW_IMAGE, } from "@/lib/mock/product-catalog" import { cn } from "@/lib/utils" function resolveWhatsNewMediaSrc( image: string | undefined, fallback?: string, ): string | undefined { if (image === LEO_WINDOW_COVER_IMAGE) return LEO_WINDOW_PREVIEW_IMAGE return image ?? fallback } /** `/whats-new` — release timeline across owned products. */ export default function WhatsNewPage() { const dashboardHref = useProductDashboardHref() const updates = useWhatsNewTimelineUpdates() const { seen, dismiss } = useWhatsNewSeen() const navigate = useNavigate() const switchProduct = useProductSwitch() const seenIds = new Set(seen) return (

What's new

{updates.length === 0 ? (

No release notes for your role right now.

) : (
    {updates.map((update, index) => { const { id, item, card, sourceLabel, brandColor } = update const unread = !seenIds.has(id) const imageSrc = resolveWhatsNewMediaSrc( item.image, card?.entry?.screens[0]?.src, ) const productLabel = sourceLabel?.replace(/^New in /, "") ?? null function openUpdate() { dismiss(id) if (card?.href) { navigate(card.href) } else if (card) { switchProduct(card.product, card.customIndex) } } return (
  1. {index < updates.length - 1 ? (
  2. ) })}
)}
) }