fix(ui/agents): swap AgentList to typed dayjs helper

Optional-chaining dayjs(...).fromNow?.() was a TS error because the
relativeTime plugin wasn't loaded. Use relativeOrAbsolute() from the
shared helper instead.
This commit is contained in:
Ishaan Jaffer 2026-05-06 15:12:08 -07:00
parent d75651912e
commit 15bb07d1fb
No known key found for this signature in database

View file

@ -3,7 +3,7 @@
import Link from "next/link";
import { Card, Table, Tag, Typography, Empty } from "antd";
import type { ColumnsType } from "antd/es/table";
import dayjs from "dayjs";
import { relativeOrAbsolute } from "@/app/(dashboard)/agents/components/_dayjs";
import type { CloudAgent } from "@/types/cloud-agents";
const { Text } = Typography;
@ -41,8 +41,7 @@ export default function AgentList({ agents, loading }: AgentListProps) {
title: "Last activity",
dataIndex: "last_activity_at",
key: "last_activity_at",
render: (value: string | null) =>
value ? dayjs(value).fromNow?.() ?? dayjs(value).format("YYYY-MM-DD HH:mm") : "—",
render: (value: string | null) => relativeOrAbsolute(value),
},
];