From 3b00fd2ec0c40e29e7c6569fce7aa982a6064d0e Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 11 Mar 2024 03:53:36 -0400 Subject: [PATCH] Cleanup and fixed data leak --- app/page.tsx | 53 ++++++--------------------------------- components/RouteCards.tsx | 2 +- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 1ea2e79..09326d0 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,20 +1,18 @@ "use client" -import { CardTitle, Card, CardDescription, CardHeader, CardContent, CardFooter } from '@/components/ui/card'; -import RouteCards from '@/components/RouteCards'; -import { Button } from '@/components/ui/button'; + import { useRoutes } from '@/lib/clientActions'; import Image from 'next/image'; import Loading from '@/components/Loading'; import Error from '@/components/Error'; import { useState } from 'react'; import { RouteDialog } from '@/components/RouteDialog'; +import Header from '@/components/Header'; +import RouteCards from '@/components/RouteCards'; export default function Home() { - const [route, setRoute] = useState(); - const [open, setOpen] = useState(false); const { data: routes, error, isLoading } = useRoutes(); let routesMap: Route[] = routes as Route[]; @@ -23,48 +21,11 @@ export default function Home() { return (
- {route && } -
- - - Active Routes - Amount of configured routes - - -
-

{routesMap.length}

-
-
- - - -
+ +
+
+
diff --git a/components/RouteCards.tsx b/components/RouteCards.tsx index fd92a81..18a04c8 100644 --- a/components/RouteCards.tsx +++ b/components/RouteCards.tsx @@ -42,7 +42,7 @@ export default function RouteCards({ routes }: { routes: Route[] }) { { routes.map((route, index) => (
- + {getHosts(route)!.values().next().value} {getHosts(route)!.map((route => {route}))}