import { useQuery } from "@tanstack/react-query"; import { useNavigate, useSearch } from "@tanstack/react-router"; import * as stylex from "@stylexjs/stylex"; import { forwardZonesQuery, localRecordsQuery } from "@/lib/queries"; import Tabs from "@/ui/Tabs"; import AuthorityGate from "./AuthorityGate"; import FileModeNote from "./FileModeNote"; import { RecordsReadOnly, ZonesReadOnly } from "./LocalReadOnly"; import QueryPanel from "./QueryPanel"; import RecordsTab from "./RecordsTab"; import UpstreamsTab from "./UpstreamsTab"; import ZonesTab from "./ZonesTab"; import { styles } from "./styles"; import type { ResolutionTab } from "./search"; function RecordsPanel() { const records = useQuery(localRecordsQuery()); return ( {(status) => status.authority === "managed_file" ? ( <> {(rows) => } ) : ( ) } ); } function ZonesPanel() { const zones = useQuery(forwardZonesQuery()); return ( {(status) => status.authority === "managed_file" ? ( <> {(rows) => } ) : ( ) } ); } /** * Resolution: where a permitted name gets its answer. Three tabs in the order * a query meets them — the pool that answers most of them, the records nxdns * answers itself, and the zones it hands to another resolver. */ export default function ResolutionPage() { const tab = useSearch({ from: "/shell/configuration/resolution" }).tab ?? "upstreams"; const navigate = useNavigate({ from: "/configuration/resolution" }); return (

Resolution

Where nxdns answers or forwards the names it permits.

void navigate({ search: { tab: key as ResolutionTab } })} tabs={[ { id: "upstreams", label: "Upstreams", content: }, { id: "records", label: "Records", content: }, { id: "zones", label: "Forward zones", content: }, ]} />
); }