"use client"; import "./components/ui/tidal.css"; import { useId, useMemo, useState, type MouseEvent } from "react"; import { TidalUptimeHistory, type TidalUptimePeriod } from "./components/ui/uptime-history"; import "./components/ui/uptime-history.css"; const tidalExampleStyles = ".uptime-demo,\n.uptime-demo * {\n box-sizing: border-box;\n}\n\n.uptime-demo {\n display: grid;\n width: min(100%, 720px);\n min-width: 0;\n gap: 12px;\n}\n\n.uptime-demo-note {\n min-width: 0;\n border: 1px solid var(--t-border);\n border-radius: var(--t-radius-control);\n background: var(--t-surface);\n color: var(--t-ink);\n}\n\n.uptime-demo-note summary {\n display: flex;\n min-height: 44px;\n align-items: center;\n padding: 8px 12px;\n font-size: 12px;\n font-weight: 720;\n cursor: pointer;\n overflow-wrap: anywhere;\n}\n\n.uptime-demo-note summary:focus-visible {\n outline: 2px solid var(--t-accent);\n outline-offset: 3px;\n}\n\n.uptime-demo-note p,\n.uptime-demo-boundary {\n min-width: 0;\n margin: 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}\n\n.uptime-demo-note p {\n padding: 0 12px 12px;\n}\n\n.uptime-demo-boundary {\n text-align: center;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .uptime-demo-note,\n .uptime-demo-note * {\n scroll-behavior: auto;\n }\n}"; const SAMPLE_PERIODS: readonly TidalUptimePeriod[] = [ { id: "oct-01", dateLabel: "Oct 1", dateTime: "2026-10-01", status: "operational", duration: "24 h", }, { id: "oct-02", dateLabel: "Oct 2", dateTime: "2026-10-02", status: "operational", duration: "24 h", }, { id: "oct-03", dateLabel: "Oct 3", dateTime: "2026-10-03", status: "operational", duration: "24 h", }, { id: "oct-04", dateLabel: "Oct 4", dateTime: "2026-10-04", status: "operational", duration: "24 h", }, { id: "oct-05", dateLabel: "Oct 5", dateTime: "2026-10-05", status: "degraded", duration: "1 h 12 m", }, { id: "oct-06", dateLabel: "Oct 6", dateTime: "2026-10-06", status: "operational", duration: "24 h", }, { id: "oct-07", dateLabel: "Oct 7", dateTime: "2026-10-07", status: "operational", duration: "24 h", }, { id: "oct-08", dateLabel: "Oct 8", dateTime: "2026-10-08", status: "operational", duration: "24 h", }, { id: "oct-09", dateLabel: "Oct 9", dateTime: "2026-10-09", status: "operational", duration: "24 h", }, { id: "oct-10", dateLabel: "Oct 10", dateTime: "2026-10-10", status: "operational", duration: "24 h", }, { id: "oct-11", dateLabel: "Oct 11", dateTime: "2026-10-11", status: "operational", duration: "24 h", }, { id: "oct-12", dateLabel: "Oct 12", dateTime: "2026-10-12", status: "maintenance", duration: "30 m", incident: { label: "Maintenance note", href: "#sample-maintenance-note", }, }, { id: "oct-13", dateLabel: "Oct 13", dateTime: "2026-10-13", status: "operational", duration: "24 h", }, { id: "oct-14", dateLabel: "Oct 14", dateTime: "2026-10-14", status: "operational", duration: "24 h", }, ]; export function UptimeHistoryDemo() { const noteId = `sample-maintenance-note-${useId().replace(/:/g, "")}`; const [noteOpen, setNoteOpen] = useState(false); const periods = useMemo( () => SAMPLE_PERIODS.map((period) => period.incident ? { ...period, incident: { ...period.incident, href: `#${noteId}`, anchorProps: { onClick: (event: MouseEvent) => { if ( event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey ) return; setNoteOpen(true); const note = event.currentTarget.ownerDocument.getElementById(noteId); if (note instanceof HTMLDetailsElement) note.open = true; }, }, }, } : period, ), [noteId], ); const [activePeriodId, setActivePeriodId] = useState("oct-12"); return (
setNoteOpen(event.currentTarget.open)} > Maintenance note

Planned sample cache update · 30 minutes.

Sample dates and durations. No monitoring or uptime calculation.

); } export default function AgentExample() { return (
); }