import { isNumericDataType } from "@/src/features/scores/lib/helpers"; import { isPresent, type ScoreConfigDomain } from "@langfuse/shared"; import React from "react"; export function ScoreConfigDetails({ config }: { config: ScoreConfigDomain }) { const { name, description, minValue, maxValue, dataType } = config; if (!description && !isPresent(minValue) && !isPresent(maxValue)) return null; const isNameTruncated = name.length > 20; return (
{!!description &&

{`Description: ${description}`}

} {isNumericDataType(dataType) && (isPresent(minValue) || isPresent(maxValue)) ? (

{`Range: [${minValue ?? "-∞"}, ${maxValue ?? "∞"}]`}

) : null} {isNameTruncated &&

{`Full name: ${name}`}

}
); }