import type { ReactNode } from "react"; import type { Level } from "../lib/log"; import { navItemAttrs } from "../lib/listNav"; import { LEVEL_TAG, logClock } from "./logLineParts"; import { Pressable } from "./ui/Pressable"; // One log line as both log viewers draw it — "Saját napló" (this tab's ring) and the admin // diagnostics console (the server's stored log): time, level, event code, message, and the line opens // in place to whatever detail its screen has. One component, so a level reads the same on both. // Inside a NavGrid the keyboard walks the lines (`j`/`k`) and Enter opens one, as a click does. export default function LogLine({ ts, level, event, msg, open, onToggle, title, navIndex, children, }: { ts: string; level: Level; event: string; msg: string; open: boolean; onToggle: () => void; /** The row button's tooltip — the admin console puts the full date there. */ title?: string; /** The line's place in its NavGrid. */ navIndex: number; /** The detail shown while the line is open. */ children: ReactNode; }) { const tag = LEVEL_TAG[level]; return (