All files / src/apps/user/pages Agents.tsx

0% Statements 0/5
0% Branches 0/2
0% Functions 0/2
0% Lines 0/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
import MainPage from "@/components/page/MainPage/MainPage";
import { APP_ROUTES } from "@/routes/const";
import { useApiHandler } from "@/services/useApiHandler";
import { useQuery } from "@tanstack/react-query";
import { Plus } from "lucide-react";
import React from "react";
import { Link } from "react-router-dom";
import AgentsGrid from "./agents/AgentsGrid";
 
const Agents: React.FC = () => {
  const { getApiHandler } = useApiHandler();
 
  const { data: agents, isLoading } = useQuery({
    queryKey: ["get:agents"],
    queryFn: () => getApiHandler().agent_router.list(undefined),
  });
 
  return (
    <MainPage
      title="Agents"
      description="Custom LLM agents with tailored personalities, context, and goals."
      links={[
        <Link
          to={APP_ROUTES.USER.INFERENCE.AGENTS.new}
          className="flex items-center gap-1.5 px-3 py-2 rounded-lg bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-sm font-medium hover:opacity-80 transition-opacity"
        >
          <Plus className="size-4" />
          New Agent
        </Link>,
      ]}
    >
      <AgentsGrid agents={agents ?? []} loading={isLoading} />
    </MainPage>
  );
};
 
export default Agents;