| 1 | import { useRouteLoaderData } from "react-router"; |
| 2 | |
| 3 | import type { loader as rootLoader } from "../root"; |
| 4 | import { setDeveloperMode, useDeveloperMode } from "../lib/developer-mode"; |
| 5 | import { SwitchCard } from "./ui/switch"; |
| 6 | |
| 7 | /** Developer mode for this browser (lib/developer-mode.ts), switched at once. */ |
| 8 | export function DeveloperModeSwitch() { |
| 9 | const on = useDeveloperMode(useRouteLoaderData<typeof rootLoader>("root")?.developer); |
| 10 | return ( |
| 11 | <SwitchCard title="Developer mode" checked={on} onCheckedChange={setDeveloperMode}> |
| 12 | When a page fails, show the error itself, its stack, where it happened and the build, with a button that copies it all for a report. Signed |
| 13 | in, errors on g1t's side come through in full too. This browser remembers it. |
| 14 | </SwitchCard> |
| 15 | ); |
| 16 | } |