import { useMemo, useState, type CSSProperties } from "react"; import { Link, NavLink, Outlet } from "react-router-dom"; import { searchSettings } from "../utils/settingsIndex"; const SUB_NAV = [ { to: "/settings/notifications", label: "Notifications" }, { to: "/settings/sign-in", label: "Sign-in" }, { to: "/settings/display", label: "Display" }, { to: "/settings/names", label: "Names" }, { to: "/settings/tags", label: "Tags" }, { to: "/settings/share", label: "Share links" }, { to: "/settings/api", label: "API and webhooks" }, { to: "/settings/data", label: "Data" }, ]; /** A box that finds a setting by what it does ("quiet hours", "prometheus", "disk full") and goes to where it is set. */ function SettingsSearch() { const [query, setQuery] = useState(""); const results = useMemo(() => searchSettings(query), [query]); return (
setQuery(e.target.value)} onKeyDown={(e) => e.key === "Escape" && setQuery("")} /> {query.trim() !== "" && (
{results.length === 0 ? (
No setting matches that.
) : ( results.map((r) => ( setQuery("")}>
{r.title}
{r.where}
)) )}
)}
); } export default function Settings() { return ( <>

Settings

{/* Tabler's default list-group-item padding (1.25rem) is sized for standalone list cards, not a nav sidebar — at that padding the first item's text sits ~12px below where the content column's own heading/button row starts, even though the two boxes themselves are top-aligned. Tightening just this list-group's own padding (via its own CSS variable, verified pixel-for-pixel against the real markup) brings the two back to the same visual line instead of only the same box height. */}
{SUB_NAV.map((item) => ( `list-group-item list-group-item-action ${isActive ? "active" : ""}`} > {item.label} ))}
); }