Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

634 B
Raw Blame
import { type ObservationLevelType } from "@langfuse/shared";

import { Badge } from "@/src/components/design-system/Badge/Badge";

type DisplayedObservationLevel = Exclude<ObservationLevelType, "DEFAULT">;

const observationLevelBadgeColors: Record<
  DisplayedObservationLevel,
  "yellow" | "red" | undefined
> = {
  DEBUG: undefined,
  WARNING: "yellow",
  ERROR: "red",
};

export function ObservationLevelBadge({
  level,
}: {
  level: DisplayedObservationLevel;
}) {
  return (
    <Badge
      color={observationLevelBadgeColors[level]}
      size="md"
      text={level.charAt(0) + level.slice(1).toLowerCase()}
    />
  );
}