/** * earth-now.co * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * File: apps/web/components/EmbedCounter.tsx * Purpose: Client wrapper for /embed/[id] — one fullscreen LiveCounter with a fixed locale and a tiny earth-now.co attribution link */ "use client"; import { useMemo, useState } from "react"; import type { CounterModel, CounterWindow } from "@earth-now/counter"; import type { Locale, MetricSummary } from "@/lib/api"; import { I18nProvider } from "@/lib/i18n"; import LiveCounter from "./LiveCounter"; export interface EmbedCounterProps { metric: MetricSummary; model?: CounterModel | undefined; window: CounterWindow; locale: Locale; } export default function EmbedCounter({ metric, model, window: win, locale }: EmbedCounterProps) { // Locale is fixed by the ?lang= query — the toggle just satisfies the provider contract. const [embedLocale, setEmbedLocale] = useState(locale); // Session window in an embed = since the iframe loaded. const sessionStart = useMemo(() => Date.now(), []); return (
earth-now.co
); }