feat: settings page with agents section, gear icon in sidebar
All checks were successful
Deploy Web Client / deploy (push) Successful in 36s

This commit is contained in:
Markov 2026-02-23 11:22:29 +01:00
parent 7c02c6d213
commit f5e4aa03fc
4 changed files with 71 additions and 16 deletions

View File

@ -0,0 +1,54 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { logout } from "@/lib/auth-client";
const MENU = [
{ href: "/settings", label: "Общие", icon: "⚙️" },
{ href: "/settings/agents", label: "Агенты", icon: "🤖" },
];
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
return (
<div className="flex-1 flex overflow-hidden">
<aside className="w-52 shrink-0 border-r border-[var(--border)] bg-[var(--card)] flex flex-col">
<div className="p-4 border-b border-[var(--border)]">
<h2 className="text-sm font-bold uppercase text-[var(--muted)]">Настройки</h2>
</div>
<nav className="flex-1 p-2 space-y-1">
{MENU.map((item) => {
const active = pathname === item.href;
return (
<Link
key={item.href}
href={item.href}
className={`flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${
active
? "bg-[var(--accent)]/10 text-[var(--accent)]"
: "text-[var(--fg)] hover:bg-white/5"
}`}
>
<span>{item.icon}</span>
{item.label}
</Link>
);
})}
</nav>
<div className="p-3 border-t border-[var(--border)]">
<button
onClick={logout}
className="text-xs text-[var(--muted)] hover:text-[var(--fg)] w-full text-left"
>
Выйти
</button>
</div>
</aside>
<div className="flex-1 overflow-y-auto">
{children}
</div>
</div>
);
}

View File

@ -0,0 +1,10 @@
"use client";
export default function SettingsPage() {
return (
<div className="p-6">
<h1 className="text-2xl font-bold mb-6"> Общие настройки</h1>
<div className="text-sm text-[var(--muted)]">Скоро здесь будут настройки проекта.</div>
</div>
);
}

View File

@ -3,7 +3,6 @@
import { useState } from "react"; import { useState } from "react";
import Link from "next/link"; import Link from "next/link";
import { Project } from "@/lib/api"; import { Project } from "@/lib/api";
import { logout } from "@/lib/auth-client";
interface Props { interface Props {
projects: Project[]; projects: Project[];
@ -39,16 +38,6 @@ export default function Sidebar({ projects, activeSlug }: Props) {
Новый проект Новый проект
</Link> </Link>
<Link
href="/agents"
onClick={() => setOpen(false)}
className="flex items-center gap-2 px-3 py-2 mb-2 rounded text-sm text-[var(--fg)]
hover:bg-white/5 transition-colors"
>
<span className="text-lg leading-none">🤖</span>
Агенты
</Link>
<div className="text-xs uppercase text-[var(--muted)] px-2 py-1 mb-1">Проекты</div> <div className="text-xs uppercase text-[var(--muted)] px-2 py-1 mb-1">Проекты</div>
{projects.map((p) => ( {projects.map((p) => (
<Link <Link
@ -68,12 +57,14 @@ export default function Sidebar({ projects, activeSlug }: Props) {
<div className="p-3 border-t border-[var(--border)] flex items-center justify-between"> <div className="p-3 border-t border-[var(--border)] flex items-center justify-between">
<span className="text-xs text-[var(--muted)]">Team Board v0.2</span> <span className="text-xs text-[var(--muted)]">Team Board v0.2</span>
<button <Link
onClick={logout} href="/settings"
className="text-xs text-[var(--muted)] hover:text-[var(--fg)]" onClick={() => setOpen(false)}
className="text-[var(--muted)] hover:text-[var(--fg)] transition-colors"
title="Настройки"
> >
Выйти
</button> </Link>
</div> </div>
</> </>
); );