import { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import PozoEstimateIcon from '../UtillComponents/Pozo retail icons/PozoEstimateIcon.jsx'; import { UpOutlined } from '@ant-design/icons'; import { GlobalOrderCardDetails, GlobalEstimateBooking, changeEstimateBooking, changeSelProdWiseEst, ChangeOverAllDiscSales, ChangeOverAllDiscEstimate, } from '../../../../Features/BookingScreen/BookingData/BookingData'; import BSEstimateModal from '../BookingFunctionality/BSEstModal'; import { GlobalpreOrderOpen } from '../../../../Features/BookingScreen/PreOrder/PreOrder.js'; import TooltipWrapper from '../../../../Components/Tooltip/Tooltip'; import { isMobile } from 'react-device-detect'; import { Popover } from 'antd'; import PozoSalesIcon from './Pozo retail icons/PozoSalesIcon.jsx'; import PozoCombinationIcon from './Pozo retail icons/PozoCombinationIcon.jsx'; const BSNavBarEstimate = () => { const dispatch = useDispatch(); const OrderCardDetails = useSelector(GlobalOrderCardDetails); const preOrderOpen = useSelector(GlobalpreOrderOpen); const EstBooking = useSelector(GlobalEstimateBooking); const [EstModalOpen, setEstModalOpen] = useState(false); const [PopOpen, setPopOpen] = useState(false); const ChangeEstMethod = () => { if (!preOrderOpen) { if (OrderCardDetails.length > 0) { setEstModalOpen(true); } } }; const EstHandleCancel = () => { setEstModalOpen(false); }; const EnableOptions = () => { setPopOpen(!PopOpen); }; const ChangeEstimateOption = (data) => { dispatch(changeEstimateBooking(data)); dispatch(ChangeOverAllDiscSales(0)); dispatch(ChangeOverAllDiscEstimate(0)); setPopOpen(false); }; const handlePopoverVisible = (visible) => { setPopOpen(visible); }; return (
{/* */}
{EstBooking === 'Sales' && } {EstBooking === 'OvrAllEst' && } {EstBooking === 'ParEst' && ( ChangeEstMethod()} /> )}
{ ChangeEstimateOption('Sales'); }} > {' '} {' '} Sales
{ ChangeEstimateOption('OvrAllEst'); }} > {' '} Estimate
{ ChangeEstimateOption('ParEst'); }} > Sales & Estimate
} trigger="click" >
{EstModalOpen && ( EstHandleCancel()} /> )}
); }; export default BSNavBarEstimate;