diff --git a/src/client/components/monitor/StatusPage/Services.tsx b/src/client/components/monitor/StatusPage/Services.tsx new file mode 100644 index 0000000..0fb25a4 --- /dev/null +++ b/src/client/components/monitor/StatusPage/Services.tsx @@ -0,0 +1,34 @@ +import { Empty } from 'antd'; +import React from 'react'; +import { MonitorHealthBar } from '../MonitorHealthBar'; + +interface StatusPageServicesProps { + workspaceId: string; + monitorList: PrismaJson.MonitorStatusPageList; +} +export const StatusPageServices: React.FC = React.memo( + (props) => { + const { workspaceId, monitorList } = props; + + return ( +
+ {monitorList.length > 0 ? ( + monitorList.map((item) => ( +
+ +
+ )) + ) : ( + + )} +
+ ); + } +); +StatusPageServices.displayName = 'StatusPageServices'; diff --git a/src/client/components/monitor/StatusPage/index.tsx b/src/client/components/monitor/StatusPage/index.tsx index d84691d..afc375d 100644 --- a/src/client/components/monitor/StatusPage/index.tsx +++ b/src/client/components/monitor/StatusPage/index.tsx @@ -1,7 +1,6 @@ -import { Button, Empty } from 'antd'; +import { Button } from 'antd'; import React, { useState } from 'react'; import { trpc } from '../../../api/trpc'; -import { MonitorHealthBar } from '../MonitorHealthBar'; import { useAllowEdit } from './useAllowEdit'; import { MonitorStatusPageEditForm, @@ -11,6 +10,7 @@ import clsx from 'clsx'; import { useRequest } from '../../../hooks/useRequest'; import { useNavigate } from 'react-router'; import { ColorSchemeSwitcher } from '../../ColorSchemeSwitcher'; +import { StatusPageServices } from './Services'; interface MonitorStatusPageProps { slug: string; @@ -94,26 +94,10 @@ export const MonitorStatusPage: React.FC = React.memo(
Services
{info && ( -
- {monitorList.length > 0 ? ( - monitorList.map((item) => ( -
- -
- )) - ) : ( - - )} -
+ )}