forked from openstatusHQ/openstatus
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmonitor.tsx
More file actions
26 lines (23 loc) · 679 Bytes
/
Copy pathmonitor.tsx
File metadata and controls
26 lines (23 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import type { z } from "zod";
import type { selectPublicMonitorSchema } from "@openstatus/db/src/schema";
import { getMonitorListData } from "@/lib/tb";
import { Tracker } from "../tracker";
import { getI18n } from '@/yuzu/server';
export const Monitor = async ({
monitor,
}: {
monitor: z.infer<typeof selectPublicMonitorSchema>;
}) => {
const data = await getMonitorListData({ monitorId: String(monitor.id) });
const t = await getI18n();
if (!data) return <div>{t('Something went wrong')}</div>;
return (
<Tracker
data={data}
id={monitor.id}
name={monitor.name}
url={monitor.url}
description={monitor.description}
/>
);
};