feat: retro Claude ekip konsolunu kur

This commit is contained in:
2026-03-16 23:38:15 +03:00
parent 9294028fb2
commit 68d5c2afea
32 changed files with 5207 additions and 0 deletions

27
web/src/hooks/useLogs.js Normal file
View File

@@ -0,0 +1,27 @@
import { useEffect, useState } from "react";
export function useLogs(socket) {
const [logs, setLogs] = useState([]);
useEffect(() => {
const handleEntry = (entry) => setLogs((current) => [...current, entry]);
const handleSnapshot = (entries) => setLogs(entries ?? []);
socket.on("log:entry", handleEntry);
socket.on("log:snapshot", handleSnapshot);
return () => {
socket.off("log:entry", handleEntry);
socket.off("log:snapshot", handleSnapshot);
};
}, [socket]);
function clearLogs() {
socket.emit("logs:clear", {}, () => {});
}
return {
logs,
clearLogs
};
}