// // Copyright 2026 James Pace // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. // // This Source Code Form is "Incompatible With Secondary Licenses", as // defined by the Mozilla Public License, v. 2.0. // import { AppNav, Footer } from "./AppNav.tsx"; import { Container, Row, Col, Image, Card } from "react-bootstrap"; import { atom, useAtomValue } from "jotai"; import { atomWithQuery } from "jotai-tanstack-query"; const costmapImageQuery = async () => { const resp = await fetch("api/costmap_image"); if (!resp.ok) { throw new Error("Network response was not ok"); } const blob = await resp.blob(); return URL.createObjectURL(blob); }; const costmapImageQueryAtom = atomWithQuery(() => ({ queryKey: ["costmap_image"], queryFn: costmapImageQuery, refetchInterval: 1000, // 1s })); const costmapImageAtom = atom((get) => { const response = get(costmapImageQueryAtom); if (response.isPending) { return
"Loading..."
; } if (response.isError) { return"Error loading!"
; } const costmapStyle = { minHeight: "65svb", }; returnStatus:
{statusString}
Latitude, Longitude:
{latLong}