Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useSDK } from "../../providers/SDKProvider";
import { isDefined } from "../../utils/utils";
import { useState, useEffect } from "react";
import { Tooltip } from "@humansignal/ui";
import { IconInfoOutline } from "@humansignal/icons";

const LOW_AGREEMENT_SCORE = 33;
const MEDIUM_AGREEMENT_SCORE = 66;
Expand All @@ -25,11 +27,20 @@ const formatNumber = (num) => {
export const AgreementSelected = (cell) => {
const { value, original: task } = cell;

const score = (
const threshold = window.APP_SETTINGS?.agreement_selected_threshold;
const overThreshold = Number(task?.total_annotations) > Number(threshold);

const content = overThreshold ? (
<Tooltip title={`Agreement (selected) is not computed for tasks with more than ${threshold} annotations`}>
<span className="inline-flex items-center text-neutral-content-subtler">
<IconInfoOutline />
</span>
</Tooltip>
) : (
<span className={agreementScoreTextColor(value)}>{isDefined(value) ? `${formatNumber(value)}%` : ""}</span>
);

return <div className="flex items-center">{score}</div>;
return <div className="flex items-center">{content}</div>;
};

AgreementSelected.userSelectable = false;
Expand Down
Loading