-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
478d2f0
commit 53fd9da
Showing
6 changed files
with
51 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/Survey/common/Components/PhotoPicker/ImageWithClassification/styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import clsx from 'clsx'; | ||
import { camera } from 'ionicons/icons'; | ||
import { IonIcon } from '@ionic/react'; | ||
import CONFIG from 'common/config'; | ||
import { Badge } from 'common/flumens'; | ||
|
||
interface Props { | ||
probability?: number; | ||
className?: string; | ||
} | ||
|
||
const ProbabilityBadge = ({ probability, className }: Props) => { | ||
if (!probability) return null; | ||
|
||
const roundedProbability = (probability * 100).toFixed(); | ||
|
||
let color; | ||
if (probability > CONFIG.POSITIVE_THRESHOLD) { | ||
color = | ||
'border border-solid border-[color:var(--classifier-success)] text-[color:var(--classifier-success)] bg-[var(--classifier-success-background)]'; | ||
} else if (probability > CONFIG.POSSIBLE_THRESHOLD) { | ||
color = | ||
'border border-solid border-[color:var(--classifier-plausible)] bg-[var(--classifier-plausible-background)] text-[color:var(--classifier-plausible)]'; | ||
} else { | ||
color = | ||
'border border-solid border-[color:var(--classifier-unlikely)] bg-[var(--classifier-unlikely-background)] text-[color:var(--classifier-unlikely)]'; | ||
} | ||
|
||
return ( | ||
<Badge | ||
className={clsx(className, color)} | ||
prefix={<IonIcon icon={camera} className="mr-[3px] text-[1em]" />} | ||
> | ||
{roundedProbability}% | ||
</Badge> | ||
); | ||
}; | ||
|
||
export default ProbabilityBadge; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters