import { createFileRoute, useNavigate } from "@tanstack/react-router" import { NewRun } from "@/components/Runs/NewRun" export const Route = createFileRoute("/_layout/runs/new")({ component: Page, // Which flow is being run is the address, so a link opens the form on it — // the same way the history screen's filter is a link. validateSearch: (search: Record): { flow?: string } => ({ flow: typeof search.flow === "string" && search.flow ? search.flow : undefined, }), head: () => ({ meta: [{ title: "New run - Fluksio" }] }), }) function Page() { const { flow } = Route.useSearch() const navigate = useNavigate() return ( navigate({ to: "/runs/new", search: { flow: next } })} /> ) }