feat: add layout
ci-front / build (push) Successful in 2m9s

This commit is contained in:
2026-04-04 03:07:45 +03:00
parent 691e1fced5
commit 57b43da2e3
7 changed files with 499 additions and 89 deletions
@@ -0,0 +1,34 @@
import { create } from "zustand";
import { agentApiService } from "@/modules/agent/api/agent.api.service";
import type { AgentInfo } from "@/modules/agent/types/agent.types";
interface AgentState {
agents: AgentInfo[];
isLoading: boolean;
error: string | null;
fetchAgents: () => Promise<void>;
removeAgent: (name: string) => void;
}
export const useAgentStore = create<AgentState>()((set, get) => ({
agents: [],
isLoading: false,
error: null,
fetchAgents: async () => {
set({ isLoading: true, error: null });
try {
const agents = await agentApiService.getAgents();
set({ agents, isLoading: false });
} catch (error) {
set({
error: error instanceof Error ? error.message : "Failed to fetch agents",
isLoading: false,
});
}
},
removeAgent: (name: string) => {
set({ agents: get().agents.filter((a) => a.name !== name) });
},
}));