import { Component } from "react"; import type { ErrorInfo, ReactNode } from "react"; import { Link, useLocation } from "react-router"; import { Button } from "@/components/ui/button"; interface RouteErrorBoundaryProps { children: ReactNode; } interface RouteErrorBoundaryState { error: Error | null; } /** * Catches render-time throws from routed views — most notably * `MissingRateError` from `src/domain/fx.ts`, which is thrown deliberately * whenever a purchase's currency has no configured exchange rate. Silently * converting at a fallback rate would show the user wrong numbers, so the * domain throws instead; this boundary is what turns that throw into a * recoverable screen instead of an unmounted app. * * Must be positioned in `App.tsx` so it wraps only the routed content, not * the `