diff options
Diffstat (limited to 'src/lib/promotinProgram/components')
| -rw-r--r-- | src/lib/promotinProgram/components/PromotionType.jsx | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/lib/promotinProgram/components/PromotionType.jsx b/src/lib/promotinProgram/components/PromotionType.jsx index 9f9fdc33..474e0fc2 100644 --- a/src/lib/promotinProgram/components/PromotionType.jsx +++ b/src/lib/promotinProgram/components/PromotionType.jsx @@ -4,6 +4,7 @@ import BottomPopup from '@/core/components/elements/Popup/BottomPopup' import CountDown2 from '@/core/components/elements/CountDown/CountDown2' import currencyFormat from '@/core/utils/currencyFormat' import odooApi from '@/core/api/odooApi' +import { getPromotionProgram } from '../api/homepageApi' const PromotionType = ({ isModal = false, @@ -14,11 +15,10 @@ const PromotionType = ({ }) => { const [selectedPromo, setSelectedPromo] = useState(null) - console.log('quantity', quantity) - const [promotionType, setPromotionType] = useState(false) const [promos, setPromotionList] = useState(null) const [activeTitle, setActiveTitle] = useState(null) + console.log('promoactiveid', promotionActiveId) useEffect(() => { const id = variantId @@ -30,7 +30,7 @@ const PromotionType = ({ } } listProgram() - handlePromoClick(promotionActiveId) + setSelectedPromo(promotionActiveId) }, []) const groupingData = promos?.reduce((groups, item) => { @@ -264,33 +264,4 @@ const PromotionType = ({ ) } -const getPromotionProgram = async ({ id }) => { - const listProgram = await odooApi('GET', `/api/v1/product_variant/${id}/promotions`) - - return listProgram -} - -const componentHarga = ({ type }) => { - console.log('saemm,,', type) - if (type === 'bundling') { - return ( - <> - <div className='flex justify-between mt-3'> - <div className='text-danger-500 font-semibold '> - {item.type.value === 'bundling' ? currencyFormat(item.price.priceDiscount) : ''} - </div> - {/* <div className='w-[50%] bg-yellow-200 rounded-full h-5'> - <div className='bg-yellow-500 h-5 rounded-full w-[90%]'> - {' '} - <span className='text-black ml-1'>+999 Produk Terjual</span> - </div> - </div> */} - </div> - </> - ) - } else if (type === 'promotion_loading') { - } else if (type === 'special_price') { - } -} - export default PromotionType |
