@@ -2,7 +2,6 @@ import { combineClassNames } from "@/submodules/javascript-functions/general";
22import { useDefaults } from "@/submodules/react-components/hooks/useDefaults" ;
33import { IconInfoCircle } from "@tabler/icons-react" ;
44import { Dispatch , Fragment , SetStateAction , useEffect , useRef , useState } from "react" ;
5- import { InformationCircleIcon } from "@heroicons/react/20/solid" ;
65import useOnClickOutside from "@/submodules/react-components/hooks/useHooks/useOnClickOutside" ;
76import { Transition } from "@headlessui/react" ;
87import { INFO_BUTTON_DEFAULT_VALUES , InfoButtonConfig , InfoButtonProps } from "../types/infoButton" ;
@@ -45,7 +44,7 @@ export function InfoButton(_props: InfoButtonProps) {
4544
4645 if ( ! config ) return null ;
4746
48- return < >
47+ return (
4948 < div className = { combineClassNames ( "relative w-fit p-1" , config . cursorClass ) } onClick = { props . access == 'click' ? config . showInfo : undefined } onMouseEnter = { props . access == 'hover' ? config . showInfo : undefined } onMouseLeave = { props . access == 'hover' ? config . hideInfo : undefined } >
5049 < IconInfoCircle size = { config . size } className = { props . infoButtonColorClass } />
5150 { props . display == "absoluteDiv" ? < RenderDiv
@@ -57,13 +56,13 @@ export function InfoButton(_props: InfoButtonProps) {
5756 onMouseLeave = { config . hideInfo }
5857 zIndexClass = { props . divZIndexClass } /> : null }
5958 </ div >
60- </ >
59+ )
6160}
6261
6362function RenderDiv ( { positionClass, open, content, access, onMouseEnter, onMouseLeave, zIndexClass } : { positionClass : string , open : boolean , content : string | JSX . Element , access : string , onMouseEnter : ( ) => void , onMouseLeave : ( ) => void , zIndexClass : string } ) {
6463 const ref = useRef ( null ) ;
6564 useOnClickOutside ( ref , onMouseLeave ) ;
66- return ( < >
65+ return (
6766 < Transition . Root show = { open } as = { Fragment } >
6867 < Transition . Child
6968 as = { Fragment }
@@ -78,13 +77,12 @@ function RenderDiv({ positionClass, open, content, access, onMouseEnter, onMouse
7877 { typeof content == "string" ?
7978 < div className = "flex items-center gap-x-2" >
8079 < div className = "flex-shrink-0" >
81- < InformationCircleIcon className = "h-5 w-5 text-blue-400" aria-hidden = "true" />
80+ < IconInfoCircle className = "h-5 w-5 text-blue-400" aria-hidden = "true" />
8281 </ div >
8382 < p className = "text-sm text-blue-700 w-max max-w-sm" > { content } </ p >
8483 </ div > : content }
8584 </ div >
8685 </ Transition . Child >
8786 </ Transition . Root >
88- </ >
8987 )
9088}
0 commit comments