| 1 | import { InformationCircleIcon } from "@heroicons/react/24/outline"; |
| 2 | import { ReactNode } from "react"; |
| 3 | import { ToolTip } from "./gui/Tooltip"; |
| 4 | |
| 5 | const DEFAULT_SIZE = "5"; |
| 6 | |
| 7 | const sizeMap = { |
| 8 | "3": "h-3 w-3", |
| 9 | "4": "h-4 w-4", |
| 10 | "5": "h-5 w-5", |
| 11 | "6": "h-6 w-6", |
| 12 | "8": "h-8 w-8", |
| 13 | } as const; |
| 14 | |
| 15 | const InfoHover = ({ |
| 16 | msg, |
| 17 | size, |
| 18 | id, |
| 19 | }: { |
| 20 | id: string; |
| 21 | msg: ReactNode; |
| 22 | size?: string; |
| 23 | }) => { |
| 24 | const sizeClasses = |
| 25 | sizeMap[size as keyof typeof sizeMap] || |
| 26 | sizeMap[DEFAULT_SIZE as keyof typeof sizeMap]; |
| 27 | |
| 28 | return ( |
| 29 | <ToolTip content={msg} place="bottom"> |
| 30 | <InformationCircleIcon className={`${sizeClasses} text-gray-500`} /> |
| 31 | </ToolTip> |
| 32 | ); |
| 33 | }; |
| 34 | |
| 35 | export default InfoHover; |