{logs.map((log, index) => {
const time = new Date(log.timestamp).toISOString().split('T')[1].slice(0, -1);
const baseClasses = "mb-1 font-mono";
const typeClasses = {
error: "text-red-400",
latency: "text-cyan-400",
llm: "text-green-400",
info: "text-gray-300"
};
// Special styling for different event types
const prefixColor = {
vad: "text-purple-400",
asr: "text-yellow-400",
server: "text-blue-400"
};
let content = log.message;
let prefix = null;
// Extract prefix if message starts with [Something]
const prefixMatch = log.message.match(/^\[(.*?)\]/);
if (prefixMatch) {
prefix = prefixMatch[0];
content = log.message.slice(prefix.length);
}
return (
[{time}]{' '}
{prefix && (
prefix?.toLowerCase().includes(key))?.[1] || typeClasses[log.type]
}>
{prefix}
)}
{log.type === 'latency' ? (
formatLatencyLog(content)
) : (
{content}
)}
);
})}