"use client"; /* eslint-disable react/require-default-props */ import { FC } from "react"; import { useRouter, usePathname, useSearchParams } from "next/navigation"; import { Box, Grid, Tooltip as MUITooltip, Button, IconButton, } from "@mui/material"; import { Close as CloseIcon } from "@mui/icons-material"; import { useTranslate } from "react-polyglot"; import { useAppContext } from "./AppProvider"; interface TooltipProps { title: string; description: string; placement: any; tooltipID: string; nextURL?: string; previousURL?: string; children: any; } export const Tooltip: FC = ({ title, description, placement, tooltipID, children, previousURL = null, nextURL = null, // eslint-disable-next-line arrow-body-style }) => { const t = useTranslate(); const { typography: { p, small }, colors: { white, leafcutterElectricBlue, almostBlack }, } = useAppContext(); const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); const activeTooltip = searchParams.get('tooltip')?.toString(); const open = activeTooltip === tooltipID; const showNavigation = true; return ( router.push(pathname)}> {title} {description} {showNavigation ? ( {previousURL ? ( ) : null} {nextURL ? ( ) : ( )} ) : null} } arrow placement={placement} sx={{ opacity: 0.9 }} componentsProps={{ tooltip: { sx: { opacity: 1.0, backgroundColor: white, color: leafcutterElectricBlue, boxShadow: "0px 6px 20px rgba(0,0,0,0.25)", }, }, arrow: { sx: { opacity: 1.0, fontSize: "22px", color: white }, }, }} > {children} ); };