62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
import { Link } from "react-router";
|
|
import {
|
|
Table,
|
|
TableBody,
|
|
TableCell,
|
|
TableHead,
|
|
TableHeader,
|
|
TableRow,
|
|
TableEmptyState,
|
|
} from "~/components/ui/table";
|
|
import { TableItemTime } from "~/components/ui/TableItems";
|
|
import type { WorkflowEvaluationProject } from "~/types/tensorzero";
|
|
import { toWorkflowEvaluationProjectUrl } from "~/utils/urls";
|
|
|
|
export default function WorkflowEvaluationProjectsTable({
|
|
workflowEvaluationProjects,
|
|
}: {
|
|
workflowEvaluationProjects: WorkflowEvaluationProject[];
|
|
}) {
|
|
return (
|
|
<div>
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead>Name</TableHead>
|
|
<TableHead>Number of Runs</TableHead>
|
|
<TableHead>Last Updated</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
{workflowEvaluationProjects.length === 0 ? (
|
|
<TableEmptyState message="No projects found" />
|
|
) : (
|
|
workflowEvaluationProjects.map((project) => (
|
|
<TableRow key={project.name}>
|
|
<TableCell className="max-w-[200px]">
|
|
<Link
|
|
to={toWorkflowEvaluationProjectUrl(project.name)}
|
|
className="block no-underline"
|
|
>
|
|
<code className="block overflow-hidden rounded font-mono text-ellipsis whitespace-nowrap transition-colors duration-300 hover:text-gray-500">
|
|
{project.name}
|
|
</code>
|
|
</Link>
|
|
</TableCell>
|
|
<TableCell>
|
|
<code className="block overflow-hidden rounded font-mono text-ellipsis whitespace-nowrap transition-colors duration-300 hover:text-gray-500">
|
|
{project.count}
|
|
</code>
|
|
</TableCell>
|
|
<TableCell>
|
|
<TableItemTime timestamp={project.last_updated} />
|
|
</TableCell>
|
|
</TableRow>
|
|
))
|
|
)}
|
|
</TableBody>
|
|
</Table>
|
|
</div>
|
|
);
|
|
}
|