From 5bdcd033f50d538779d511f40988560069c2c59d Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Wed, 18 Dec 2024 15:53:36 +0100 Subject: [PATCH] remove now obsolete components --- extension/src/panel/pages/routes/Routes.tsx | 34 --------------------- extension/src/panel/pages/routes/index.tsx | 5 +-- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 extension/src/panel/pages/routes/Routes.tsx diff --git a/extension/src/panel/pages/routes/Routes.tsx b/extension/src/panel/pages/routes/Routes.tsx deleted file mode 100644 index 95381bcc2..000000000 --- a/extension/src/panel/pages/routes/Routes.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { - getLastUsedRouteId, - getRoutes, - ProvideExecutionRoute, -} from '@/execution-routes' -import { ProvideProvider } from '@/providers-ui' -import { invariant } from '@epic-web/invariant' -import { Outlet, useLoaderData } from 'react-router' - -export const loader = async () => { - const lastUsedRouteId = await getLastUsedRouteId() - - invariant(lastUsedRouteId != null, 'Cannot edit routes without an active one') - - const routes = await getRoutes() - - const route = routes.find((route) => route.id === lastUsedRouteId) - - invariant(route != null, `Could not find route with id "${lastUsedRouteId}"`) - - return { route } -} - -export const Routes = () => { - const { route } = useLoaderData() - - return ( - - - - - - ) -} diff --git a/extension/src/panel/pages/routes/index.tsx b/extension/src/panel/pages/routes/index.tsx index 8de5d730b..42b742d01 100644 --- a/extension/src/panel/pages/routes/index.tsx +++ b/extension/src/panel/pages/routes/index.tsx @@ -1,14 +1,11 @@ import { redirect, type RouteObject } from 'react-router' import { EditRoute } from './edit.$routeId' import { ListRoutes } from './list' -import { loader, Routes } from './Routes' export const routes: RouteObject = { path: 'routes', - element: , - loader, children: [ - { path: '', loader: () => redirect('list') }, + { index: true, loader: () => redirect('list') }, ListRoutes, EditRoute, ],