'use client'; import { X } from 'lucide-react'; import type { Waypoint } from '@/utils/waypoints'; type Props = { waypoints: Waypoint[]; /** Add every new waypoint to its default group and mark them seen. */ onAdd: () => void; /** Mark the new waypoints seen without adding them. */ onDismiss: () => void; }; /** * Dismissable "new waypoints" notice. Surfaces built-in waypoints that have * shipped since the user last acknowledged the catalog, with a one-click * "Add" that drops them into their default groups. Rendered on the * universal-link picker and in account settings. Mirrors the extension's * popup banner. */ export default function NewWaypointsBanner({ waypoints, onAdd, onDismiss }: Props) { if (waypoints.length === 0) return null; const names = waypoints.map((w) => w.name); let summary: string; if (names.length === 1) summary = `${names[0]} is a new waypoint`; else if (names.length <= 3) summary = `New waypoints: ${names.join(', ')}`; else summary = `${names.slice(0, 2).join(', ')} and ${names.length - 2} more new waypoints`; const addLabel = waypoints.length === 1 ? 'Add it' : 'Add all'; return (
{waypoints.slice(0, 3).map((w) => ( {w.icon} ))} {summary}
); }