"use client";

import { useEffect, useState } from "react";

// Reads the year in an effect (post-hydration only) so the clock is never
// accessed during prerender — Cache Components disallows that in both Server
// and Client Components (without a Suspense boundary).
export const CurrentYear = () => {
  const [year, setYear] = useState<number | null>(null);
  useEffect(() => setYear(new Date().getFullYear()), []);
  return <>{year}</>;
};
