import { EndpointResult, ENDPOINT_DISPLAY_NAMES } from "@/data/sampleData";
import { CheckCircle2, AlertTriangle, XCircle } from "lucide-react";
interface PredictionCardProps {
endpointKey: string;
result: EndpointResult;
}
function getStatusInfo(label: string) {
const lower = label.toLowerCase().trim();
if (
lower.includes("non-inhibitor") ||
lower.includes("non-substrate") ||
lower.includes("non ames toxic") ||
lower.includes("non-carcinogens") ||
lower.includes("weak inhibitor") ||
lower.includes("low cyp") ||
lower.includes("ready biodegradable") ||
lower === "true"
) {
return {
icon: ,
badgeClass:
"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",
barColor: "bg-emerald-500",
};
}
if (
lower.includes("inhibitor") ||
lower.includes("substrate") ||
lower.includes("ames toxic") ||
lower.includes("carcinogens") ||
lower.includes("strong inhibitor") ||
lower.includes("high cyp") ||
lower.includes("not ready")
) {
return {
icon: ,
badgeClass: "bg-red-500/20 text-red-400 border border-red-500/30",
barColor: "bg-red-500",
};
}
return {
icon: ,
badgeClass: "bg-amber-500/20 text-amber-400 border border-amber-500/30",
barColor: "bg-amber-500",
};
}
export default function PredictionCard({
endpointKey,
result,
}: PredictionCardProps) {
const displayName = ENDPOINT_DISPLAY_NAMES[endpointKey] || endpointKey;
const status = getStatusInfo(result.label);
const probPercent = (result.prob * 100).toFixed(1);
return (
{status.icon}
{displayName}
{result.label.trim()}
Probability (Class 1)
{probPercent}%
);
}