// Shared localStorage tracker for the "What's New" badge.
//
// sidebar.ts reads the stamp on every page to ask the backend how many
// entries are newer; changelog.ts writes the stamp when the user visits
// /changelog so the badge clears on their next page load.

export const SEEN_KEY = "paliad-changelog-seen";

export function getChangelogSeen(): string {
  return localStorage.getItem(SEEN_KEY) ?? "";
}

export function markChangelogSeen(): void {
  localStorage.setItem(SEEN_KEY, new Date().toISOString());
}
