feat(analysis): make analysis page work for all currencies (BELO, BLUE, BNA)

- Replace hardcoded BELO analysis with generic AnalysisPage
- Add /quotes/analysis/ route with currency path param
- Add currency selector tabs on analysis page
- Dashboard QuoteCards now navigate to analysis for all currencies
- Old /quotes/belo/analysis redirects to /quotes/analysis/BELO
This commit is contained in:
Jose Selesan
2026-06-12 16:44:20 -03:00
parent 142fd4e33f
commit c0c8bf0945
5 changed files with 79 additions and 17 deletions

View File

@@ -0,0 +1,20 @@
import { createFileRoute, redirect } from "@tanstack/react-router";
import { AnalysisPage } from "@/features/analysis/AnalysisPage";
const VALID_CURRENCIES = ["BELO", "BLUE", "BNA"];
export const Route = createFileRoute(
"/_authenticated/quotes/analysis/$currency",
)({
component: RouteComponent,
loader: ({ params }) => {
if (!VALID_CURRENCIES.includes(params.currency)) {
throw redirect({ to: "/quotes" });
}
},
});
function RouteComponent() {
const { currency } = Route.useParams();
return <AnalysisPage currency={currency} />;
}

View File

@@ -1,6 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";
import { BeloAnalysisPage } from "@/features/belo/BeloAnalysisPage";
import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/_authenticated/quotes/belo/analysis")({
component: BeloAnalysisPage,
loader: () => {
throw redirect({ to: "/quotes/analysis/$currency", params: { currency: "BELO" } });
},
});