"use client"
import Image from 'next/image'
import React, { useContext, useEffect } from 'react'
import { CartContext } from '../../../components/AppContext'

const OrdersPage = () => {
    const {clearCart} = useContext(CartContext);

    useEffect(() => {
        if(typeof window !== 'undefined'){
            if(window.location.href.includes('clear-cart=1')){
                clearCart();
            }
        }
    }, [])


  return (
    <div className='pb-20 md:pb-40'>
        <div className='px-5 md:px-10 py-5 sm:py-10 max-w-2xl mx-auto'>
            <div className='flex flex-col gap-4 items-center justify-center text-center mb-10'>
                <Image src='/check.png' width={100} height={100} alt='checked' className='mb-6'/>
                <p className='uppercase'>Thank you</p>
                <p className='uppercase text-xl'>Your order is confirmed</p>
                <p className='text-sm'>We will be sending you an email confirmation to your email shortly</p>
            </div>
            product
        </div>
    </div>
  )
}

export default OrdersPage