import { memo } from 'react'; import { cn } from '@/lib/utils'; import type { ParsedLogRow, LogStage } from './composeLogParser'; interface StructuredLogRowProps { row: ParsedLogRow; } const BADGE_CLASSES: Record = { PULL: 'bg-brand/10 text-brand', BUILD: 'bg-warning/10 text-warning', CREATE: 'bg-brand/10 text-brand', START: 'bg-success/10 text-success', STOP: 'bg-warning/10 text-warning', DOWN: 'bg-muted/60 text-muted-foreground', WARN: 'bg-warning/10 text-warning', ERR: 'bg-destructive/10 text-destructive', LOG: 'bg-muted/30 text-muted-foreground/70', }; function StructuredLogRowBase({ row }: StructuredLogRowProps) { const isError = row.level === 'error'; const isWarn = row.level === 'warn'; return (
{row.timestamp.substring(11, 19)} {row.stage} {row.message}
); } export const StructuredLogRow = memo(StructuredLogRowBase); export default StructuredLogRow;