diff --git a/README.md b/README.md
index 9ae3450..b5c1511 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ Please refer to [Wiki](https://github.com/lyc8503/UptimeFlare/wiki)
- [x] ~~Self-host Dockerfile~~
- [x] Incident history
- [ ] Improve `checkLocationWorkerRoute` and fix possible `proxy failed`
-- [ ] Groups
+- [x] Groups
- [x] Remove old incidents
- [ ] Known issue: `fetch` doesn't support non-standard port
- [ ] Update wiki and add docs for dev
diff --git a/components/MonitorList.tsx b/components/MonitorList.tsx
index e4c4682..ac33ea5 100644
--- a/components/MonitorList.tsx
+++ b/components/MonitorList.tsx
@@ -1,8 +1,85 @@
import { MonitorState, MonitorTarget } from '@/uptime.types'
-import { Card, Center } from '@mantine/core'
+import { Accordion, Card, Center, Text } from '@mantine/core'
import MonitorDetail from './MonitorDetail'
+import { pageConfig } from '@/uptime.config';
+
+function countDownCount(state: MonitorState, ids: string[]) {
+ let downCount = 0
+ for (let id of ids) {
+ if (state.incident[id] === undefined || state.incident[id].length === 0) {
+ continue
+ }
+
+ if (state.incident[id].slice(-1)[0].end === undefined) {
+ downCount++
+ }
+ }
+ return downCount
+}
+
+function getStatusTextColor(state: MonitorState, ids: string[]) {
+ let downCount = countDownCount(state, ids)
+ if (downCount === 0) {
+ return '#059669'
+ } else if (downCount === ids.length) {
+ return '#df484a'
+ } else {
+ return '#f29030'
+ }
+}
+
+export default function MonitorList({ monitors, state }: { monitors: MonitorTarget[]; state: MonitorState }) {
+ // @ts-ignore
+ let group: any = pageConfig.group
+ let groupedMonitor = group && Object.keys(group).length > 0
+ let content
+
+ if (groupedMonitor) {
+ // Grouped monitors
+ content = (
+