"use client";

import clsx from "clsx";

export default function FooterBtnInAddToCartModal({
    isAvailable,
    onBuyNow,
    onAddToCart
}: {
    isAvailable: boolean; 
    onBuyNow: () => void,
    onAddToCart: () => void
}) {

    const btnClass = 'flex-none flex items-center justify-center w-40 h-11.5 rounded-4xl text-ly-16 font-bold text-white';
    return (
        <div className="flex justify-between">
            {isAvailable ? 
                (<>
                    <button className={clsx(btnClass,'bg-ly-deepgreen')}
                        onClick={onBuyNow}
                    >
                        Buy Now
                        
                    </button>
                    <button className={clsx(btnClass, 'bg-ly-middlegreen')}
                        onClick={onAddToCart}
                    >
                        Add to Cart
                    </button>
                </>)
            :
                <p className="text-center text-ly-14">The selected options are not available!</p>
            }
            
        </div>
    );
}