Reading logged
{/* Recap card */}Thanks for keeping the records flowing.
"use client"; /** * MobileWaterSuccessScreen — confirmation after a successful submit. * * Visual structure: * - Centered success illustration: a green ring that draws on, * with a checkmark that draws on ~280ms later (the same staggered * reveal UIKit's success feedback uses). * - Headline: "Reading logged." * - Recap card: headgate name + measurement + unit + timestamp. * - Two large primary actions, stacked: * - "Log Another Entry" (green primary, refresh icon) * - "Back to Headgates" (white secondary with thin border) * - Subtle thank-you micro-copy at the bottom. * * The animations use the global `water-ring` + `water-draw` keyframes * from `src/app/globals.css`. */ import { useEffect, useState } from "react"; import { Grid, Refresh } from "./icons"; import { formatClockTime, formatLongTimestamp, formatMeasurement } from "./format"; type Props = { headgateName: string; measurement: number; unit: string; timestamp: Date; /** Name of the irrigator who logged the entry — shown in the recap * so the operator can confirm the reading is attributed to them. */ irrigatorName?: string; onLogAnother: () => void; onBackToHeadgates: () => void; }; export function MobileWaterSuccessScreen({ headgateName, measurement, unit, timestamp, irrigatorName, onLogAnother, onBackToHeadgates, }: Props) { // Reveal animation — staggered for ring → checkmark → content. const [ringDone, setRingDone] = useState(false); const [contentShown, setContentShown] = useState(false); useEffect(() => { const ringTimer = window.setTimeout(() => setRingDone(true), 380); const contentTimer = window.setTimeout(() => setContentShown(true), 480); return () => { window.clearTimeout(ringTimer); window.clearTimeout(contentTimer); }; }, []); return (
Thanks for keeping the records flowing.