* fix: use backlinks history for default trends * simplify backlinks: remove filters, always use history endpoint Remove the filter UI (status, subdomains, indirect links, exclude internal) and hardcode defaults across the stack. Replace the conditional timeseries_summary + timeseries_new_lost_summary fallback with a single backlinks/history/live call for trend data. This reduces the overview from 5 parallel API calls to 3 and removes all conditional branching. * improve charts * fix: refresh backlinks cost docs
29 lines
924 B
TypeScript
29 lines
924 B
TypeScript
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
|
import { BacklinksPage } from "@/client/features/backlinks/BacklinksPage";
|
|
import { inferBacklinksSearchScopeFromTarget } from "@/client/features/backlinks/backlinksSearchScope";
|
|
import { backlinksSearchSchema } from "@/types/schemas/backlinks";
|
|
|
|
export const Route = createFileRoute("/_project/p/$projectId/backlinks")({
|
|
validateSearch: backlinksSearchSchema,
|
|
component: BacklinksRoute,
|
|
});
|
|
|
|
function BacklinksRoute() {
|
|
const { projectId } = Route.useParams();
|
|
const navigate = useNavigate({ from: Route.fullPath });
|
|
const { target = "", scope: rawScope, tab = "backlinks" } = Route.useSearch();
|
|
const scope = rawScope ?? inferBacklinksSearchScopeFromTarget(target);
|
|
|
|
return (
|
|
<BacklinksPage
|
|
projectId={projectId}
|
|
navigate={navigate}
|
|
searchState={{
|
|
target,
|
|
scope,
|
|
tab,
|
|
}}
|
|
/>
|
|
);
|
|
}
|