import { h } from 'preact'; import { Signal } from '@preact/signals-core'; interface CommandLogProps { entries: Signal>; maxEntries?: number; } export function CommandLog({ entries, maxEntries = 50 }: CommandLogProps) { const displayEntries = entries.value.slice(-maxEntries).reverse(); return (
{displayEntries.length === 0 ? (
No commands yet
) : (
{displayEntries.map((entry, i) => (
{new Date(entry.timestamp).toLocaleTimeString()} > {entry.input} {entry.result}
))}
)}
); }