diff --git a/pages/services.tsx b/pages/services.tsx index 03e3efe..abdeb32 100644 --- a/pages/services.tsx +++ b/pages/services.tsx @@ -1,31 +1,40 @@ import Head from 'next/head' import Link from 'next/link' import styles from '/styles/Home.module.css' -import { Service, ServiceStatus, ServiceType, ServiceLocation } from '../interfaces/LinkTypes'; +import { Service, ServiceStatus, ServiceType, ServiceLocation } from '../interfaces/Services'; import Dockerode from 'dockerode'; import { ReactElement } from 'react' import useSWR from 'swr'; +import Image from 'next/image'; const fetcher = (url: string) => fetch(url).then((res) => res.json()) function Services() { const { initialData, fullData, loadingInitial, loadingFull, error } = useServices(); - let content: ReactElement = <>; if (error) { content =
Error loading data
} - else if (loadingInitial) { - content =
Loading
- } + else if (loadingInitial) { content =
Loading
} else if (loadingFull) { content =
{initialData?.map((item: Service) => ( -

{item.name}

-
{item.status}
+
+ { + item.icon ? ( +
+ icon +
+ ) : (<>) + } +

{item.name}

+
+
+ {item.status} +

{item.desc}

{item.warn}

@@ -39,8 +48,19 @@ function Services() { {fullData.map((item: Service) => ( -

{item.name}

-
{item.status}
+
+ { + item.icon ? ( +
+ icon +
+ ) : (<>) + } +

{item.name}

+
+
+ {item.status} +

{item.desc}

{item.warn}