import { useEffect, useState } from 'react'; import { Popover, Input, Button } from 'antd'; import { useDispatch, useSelector } from "react-redux"; import { GiPayMoney } from "react-icons/gi"; import { GlobaltipAmount, changeTipAmount } from "../../../../Features/BookingScreen/BookingData/BookingData"; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import { isMobile } from 'react-device-detect'; const BSTipAmount = () => { const globalTipAmount = useSelector(GlobaltipAmount); const [visible, setVisible] = useState(false); const [tipAmount, setTipAmount] = useState(globalTipAmount); const dispatch = useDispatch(); const handleOk = () => { if (changeTipAmount) { dispatch(changeTipAmount(tipAmount)); } setVisible(false); }; const handleCancel = () => { setTipAmount(''); setVisible(false); }; useEffect(() => { if (globalTipAmount > 0) { setTipAmount(globalTipAmount) } else { setTipAmount(0) } }, [globalTipAmount]) console.log(globalTipAmount, "tipAmounttipAmount"); const content = (