Files
vkv/resources/js/components/EvaluationEventsList.tsx
Zdeněk Burda 41e3ce6f25 Initial commit
2026-01-09 21:26:40 +01:00

33 lines
977 B
TypeScript

import { type EvaluationRunEvent } from "@/hooks/useRoundEvaluationRun";
type EvaluationEventsListProps = {
events: EvaluationRunEvent[];
formatEventTime: (value?: string | null) => string | null;
};
export default function EvaluationEventsList({
events,
formatEventTime,
}: EvaluationEventsListProps) {
if (events.length === 0) return null;
return (
<div className="text-sm text-foreground-700">
<div className="font-semibold mb-1">Poslední události</div>
<div className="space-y-1">
{events.map((event) => (
<div key={event.id} className="flex flex-col">
<span>
[{event.level}] {event.message}
</span>
<span className="text-xs text-foreground-500">
{formatEventTime(event.created_at) ?? "—"}
{event.context?.step ? ` • krok: ${String(event.context.step)}` : ""}
</span>
</div>
))}
</div>
</div>
);
}