+ {isLoading ? (
+
+
+
+ ) : providers.length === 0 && !searchQuery ? (
+
+ {!isProviderFormOpen && (
+
+
+
Create a new provider
+
+ )}
+
+ ) : filteredProviders.length === 0 && searchQuery ? (
No providers or models found matching your search.
diff --git a/ui/src/components/table-list-page.tsx b/ui/src/components/table-list-page.tsx
index e7d31ae..8dc14c5 100644
--- a/ui/src/components/table-list-page.tsx
+++ b/ui/src/components/table-list-page.tsx
@@ -1,13 +1,7 @@
import { deleteTable, getTableSchema, TableCreateRequest } from "@/actions";
import { ImportFileDialog } from "@/components/dialog/import-file";
-import {
- Card,
- CardContent,
- CardFooter,
- CardHeader,
-} from "@/components/ui/card";
import { CommonCard } from "@/components/ui/common-card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { IconSpinner } from "@/components/ui/icons";
import { useCreateTableDialog } from "@/context/create-table";
import { useTables } from "@/context/tables";
import { JSONObject } from "@/json.ts";
@@ -132,42 +126,33 @@ function TableList({ searchQuery }: TableListProps) {
};
return (
-
+
+ {loading && (
+
+
+
+ )}
- {loading
- ? Array.from({ length: 4 }).map((_, index) => (
-
-
-
-
-
-
-
-
-
-
-
-
- ))
- : tables
- .filter((table) =>
- table.name.toLowerCase().includes(searchQuery.toLowerCase()),
- )
- .map((table) => (
-
navigate(`/tables/${table.id}`)}
- onEdit={() => handleEditTableClick(table.id)}
- onDelete={async () => {
- await deleteTable(table.id);
- await fetchTables();
- refreshTables();
- }}
- >
- {table.description}
-
- ))}
+ {!loading &&
+ tables
+ .filter((table) =>
+ table.name.toLowerCase().includes(searchQuery.toLowerCase()),
+ )
+ .map((table) => (
+
navigate(`/tables/${table.id}`)}
+ onEdit={() => handleEditTableClick(table.id)}
+ onDelete={async () => {
+ await deleteTable(table.id);
+ await fetchTables();
+ refreshTables();
+ }}
+ >
+ {table.description}
+
+ ))}
);
diff --git a/ui/src/components/ui/icons.tsx b/ui/src/components/ui/icons.tsx
index ecf2cd3..df4cfc3 100644
--- a/ui/src/components/ui/icons.tsx
+++ b/ui/src/components/ui/icons.tsx
@@ -17,4 +17,24 @@ function IconGithub({ className, ...props }: React.ComponentProps<"svg">) {
);
}
-export { IconGithub };
+function IconSpinner({ className, ...props }: React.ComponentProps<"svg">) {
+ return (
+
+ );
+}
+
+export { IconGithub, IconSpinner };
diff --git a/ui/src/components/workflow-list-page.tsx b/ui/src/components/workflow-list-page.tsx
index b9f8e3c..8760643 100644
--- a/ui/src/components/workflow-list-page.tsx
+++ b/ui/src/components/workflow-list-page.tsx
@@ -7,14 +7,8 @@ import {
} from "@/actions";
import WorkflowBuilderDialog from "@/components/dialog/workflow/builder";
import WorkflowExecutionDialog from "@/components/dialog/workflow/workflow";
-import {
- Card,
- CardContent,
- CardFooter,
- CardHeader,
-} from "@/components/ui/card";
import { CommonCard } from "@/components/ui/common-card";
-import { Skeleton } from "@/components/ui/skeleton";
+import { IconSpinner } from "@/components/ui/icons";
import { PlusIcon } from "@radix-ui/react-icons";
import { useCallback, useEffect, useState } from "react";
import { ModeToggle } from "./darkmode";
@@ -90,58 +84,49 @@ export function WorkflowListPage() {
-
- {loading &&
- Array.from({ length: 4 }).map((_, index) => (
-
-
-
-
-
-
-
-
-
-
-
-
- ))}
- {!loading &&
- workflows
- .filter((wf) =>
+
+ {loading ? (
+
+
+
+ ) : (
+ <>
+ {workflows
+ .filter((wf) =>
+ wf.name.toLowerCase().includes(searchQuery.toLowerCase()),
+ )
+ .map((wf) => (
+
{
+ const w = await getWorkflow(wf.id);
+ setWorkflow(w);
+ setRunWorkflowOpen(true);
+ }}
+ onEdit={async () => {
+ const w = await getWorkflow(wf.id);
+ setWorkflow(w);
+ setRunWorkflowBuilderOpen(true);
+ }}
+ onDelete={async () => {
+ await deleteWorkflow(wf.id);
+ await refreshWorkflows();
+ }}
+ >
+ {wf.description}
+
+ ))}
+ {workflows.filter((wf) =>
wf.name.toLowerCase().includes(searchQuery.toLowerCase()),
- )
- .map((wf) => (
-
{
- const w = await getWorkflow(wf.id);
- setWorkflow(w);
- setRunWorkflowOpen(true);
- }}
- onEdit={async () => {
- const w = await getWorkflow(wf.id);
- setWorkflow(w);
- setRunWorkflowBuilderOpen(true);
- }}
- onDelete={async () => {
- await deleteWorkflow(wf.id);
- await refreshWorkflows();
- }}
- >
- {wf.description}
-
- ))}
- {!loading &&
- workflows.filter((wf) =>
- wf.name.toLowerCase().includes(searchQuery.toLowerCase()),
- ).length === 0 &&
- searchQuery && (
-
- No workflows found matching your search.
-
- )}
+ ).length === 0 &&
+ searchQuery && (
+
+ No workflows found matching your search.
+
+ )}
+ >
+ )}