import Link from "next/link"; import { ago } from "@/components/common"; import { requireUser } from "@/lib/auth"; import { activeSessions, inbox } from "@/lib/queries"; import { SESSION_STATUS, TONE_BG } from "@/lib/status"; import { cn } from "@/lib/utils"; /** Default right panel: what waits for the PM and what is running now. */ export async function ActivityAside({ questions = true }: { questions?: boolean }) { const user = await requireUser(); const [items, sessions] = await Promise.all([questions ? inbox(user.id) : [], activeSessions(user.id)]); return (
{questions && ( {items.length === 0 ? (

Агентам ничего не нужно.

) : ( items.slice(0, 6).map((q) => ( {q.taskKey ?? `#${q.id}`}{" "} {q.text} )) )}
)} {sessions.length === 0 ? (

Сейчас ничего не запущено.

) : ( sessions.slice(0, 12).map((s) => { const st = SESSION_STATUS[s.status] ?? { label: s.status, tone: "muted" as const }; return ( {s.taskKey ?? s.projectKey} {s.taskTitle} {ago(s.lastActivityAt)} ); }) )}
); } export function PanelSection({ title, count, href, more, children }: { title: string; count?: number; href?: string; more?: string; children: React.ReactNode }) { return (

{title} {count != null && count > 0 && {count}} {href && more && ( {more} → )}

{children}
); }