({
isLoading,
risk,
}: RiskIndicatorProps)
| 22 | */ |
| 23 | |
| 24 | const RiskIndicator: FC<RiskIndicatorProps> = ({ |
| 25 | isLoading, |
| 26 | risk, |
| 27 | }: RiskIndicatorProps) => { |
| 28 | const color: RiskLevelColors | null = risk ? getRiskLevelColors(risk) : null; |
| 29 | |
| 30 | return ( |
| 31 | <span |
| 32 | className={clsx( |
| 33 | "group my-1 flex h-12 w-12 items-center justify-center rounded-md text-lg font-semibold shadow-sm ring-1", |
| 34 | color?.textColor, |
| 35 | color?.backgroundColor, |
| 36 | color?.hoveredBackgroundColor, |
| 37 | color?.ringColor, |
| 38 | )} |
| 39 | > |
| 40 | {isLoading ? <LoadingCircle className="p-3" /> : round(risk!, 1)} |
| 41 | <div className="pointer-events-none absolute mb-48 mt-0.5 w-max origin-bottom scale-0 divide-y divide-gray-700 rounded-lg bg-gray-800 px-3 py-3 text-white opacity-0 shadow-sm transition-all duration-300 ease-in-out group-hover:scale-100 group-hover:opacity-100 dark:bg-gray-700 "> |
| 42 | <div className="flex flex-row items-center gap-x-1.5 pb-1"> |
| 43 | <InformationCircleIcon className="h-5 w-5 text-blue-200" /> |
| 44 | <h1 className="text-base font-semibold leading-7">Risk Score</h1> |
| 45 | </div> |
| 46 | <div className="flex max-w-xs flex-col gap-y-1.5 pt-1 text-xs font-normal text-gray-400"> |
| 47 | The risk score goes from 1 to 10 and is calculated based on the |
| 48 | following parameters: |
| 49 | <ul className="flex flex-col gap-y-2 pl-3 text-white"> |
| 50 | <li className="flex flex-row items-center gap-x-1"> |
| 51 | <IdentificationIcon className="h-5 w-5 text-blue-200" /> |
| 52 | <span className="font-bold">Labeled data</span>of the address |
| 53 | </li> |
| 54 | <li className="flex flex-row items-center gap-x-1"> |
| 55 | <ArrowsPointingInIcon className="h-5 w-5 text-blue-200" /> |
| 56 | <span className="font-bold">Direct Exposure,</span> both incoming |
| 57 | and outgoing |
| 58 | </li> |
| 59 | <li className="flex flex-row items-center gap-x-1"> |
| 60 | <ChevronDoubleDownIcon className="h-5 w-5 text-blue-200" /> |
| 61 | <span className="font-bold">Indirect Exposure,</span> both |
| 62 | incoming and outgoing |
| 63 | </li> |
| 64 | </ul> |
| 65 | </div> |
| 66 | </div> |
| 67 | </span> |
| 68 | ); |
| 69 | }; |
| 70 | |
| 71 | export default RiskIndicator; |
nothing calls this directly
no test coverage detected