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,31 @@
import { useState, useEffect, type ReactNode } from "react";
import { Sidebar } from "@/app/providers/layout/sidebar/sidebar";
import { Navigation } from "@/app/providers/layout/navigation/navigation";
import { useAgentStore } from "@/app/providers/layout/store/agent.store";
export const Layout = ({ children }: { children: ReactNode }) => {
const [isOpen, setOpen] = useState(true);
const { fetchAgents } = useAgentStore();
useEffect(() => {
fetchAgents();
}, [fetchAgents]);
useEffect(() => {
const interval = setInterval(() => {
fetchAgents();
}, 30000);
return () => clearInterval(interval);
}, [fetchAgents]);
return (
<div className="flex h-screen overflow-hidden" style={{ backgroundColor: "var(--bg-primary)" }}>
<Sidebar isOpen={isOpen} onToggle={() => setOpen(!isOpen)} />
<div className="flex-1 flex flex-col min-w-0 overflow-hidden">
<Navigation />
<div className="flex-1 overflow-auto p-4">{children}</div>
</div>
</div>
);
};