New workflow table (#661)

This commit is contained in:
Kerem Yilmaz
2024-07-30 11:17:29 -07:00
committed by GitHub
parent 3c81e4269a
commit dadb3724b7
7 changed files with 257 additions and 14 deletions

View File

@@ -0,0 +1,27 @@
import { Skeleton } from "@/components/ui/skeleton";
import { useWorkflowLastRunQuery } from "../hooks/useWorkflowLastRunQuery";
import { basicTimeFormat } from "@/util/timeFormat";
type Props = {
workflowId: string;
};
function LastRunAtTime({ workflowId }: Props) {
const { data, isLoading } = useWorkflowLastRunQuery({ workflowId });
if (isLoading) {
return <Skeleton className="h-full w-full" />;
}
if (!data) {
return null;
}
if (data.status === "N/A") {
return <span>N/A</span>;
}
return <span>{basicTimeFormat(data.time)}</span>;
}
export { LastRunAtTime };