import * as React from 'react' import { cn } from '../utils/cn' import { LogsListProps, LogEntry } from '../types/logs.types' import { LogSeverityDot } from './log-severity-dot' import { ToolIcon } from './tool-icon' const formatTimestamp = (timestamp: string | Date): string => { const date = timestamp instanceof Date ? timestamp : new Date(timestamp) // UTC getters so the timestamp is identical on server (UTC) and client // (local) — otherwise React #418 hydration mismatch. const year = date.getUTCFullYear() const month = String(date.getUTCMonth() + 1).padStart(2, '0') const day = String(date.getUTCDate()).padStart(2, '0') const hours = String(date.getUTCHours()).padStart(2, '0') const minutes = String(date.getUTCMinutes()).padStart(2, '0') return `${year}/${month}/${day},${hours}:${minutes}` } const LogCard: React.FC<{ log: LogEntry isLast: boolean showConnector: boolean onClick?: () => void }> = ({ log, isLast, showConnector, onClick }) => { return (
{log.title}
{formatTimestamp(log.timestamp)}
{log.toolType && (