MyGiftCard.js 3.41 KB
import Image from "next/image";
import React, { Fragment } from "react";
import { Button } from "react-bootstrap";
import { cleanImage, renderImage } from "../../services/imageHandling";
import { useSelector } from "react-redux";

const MyGiftCard = () => {
    const { giftCard } = useSelector(state => state.giftCard);
    console.log("giftCard >>>>>", giftCard)
    const giftCardData = [
        {
            id: "0",
            sender_email: "John@gmail.com",
            receiver_email: "martha@gmail.com",
            gift_amount: "$750",
            image: "/images/zango-logo.svg"
        },
        {
            id: "1",
            sender_email: "John@gmail.com",
            receiver_email: "martha@gmail.com",
            gift_amount: "$750",
            image: "/images/zango-logo.svg"
        },
        {
            id: "2",
            sender_email: "John@gmail.com",
            receiver_email: "martha@gmail.com",
            gift_amount: "$750",
            image: "/images/zango-logo.svg"
        },
    ]

    return (
        <Fragment>
            <div className="container">
                <div className="row">
                    <div className="col-12 col-lg-12 form-container content-wraaper">
                        <h2>My Gift Card</h2>
                        <div className="row">
                            {giftCard?.length && giftCard.map((data, index) => (
                                <div className="col-12 col-lg-4" key={`1${index}`}>
                                    <div className="card-booking">
                                        <div className="card-booking-img bgGrey">
                                            <span className="image-container">
                                                <Image src={cleanImage(data.attributes.image.data.attributes)} layout="fill" className="image" />
                                            </span>
                                        </div>
                                        <div className="card-booking-content details-wrapper">
                                            <p className="details">Details</p>
                                            <div className="d-flex align-items-start justify-content-between">
                                                <div className="details-div">
                                                    <p>Senders Email Id</p>
                                                    <p>{data.attributes.senderEmail}</p>
                                                </div>
                                                <div className="details-div">
                                                    <p>Receivers Email Id</p>
                                                    <p>{data.attributes.receiverEmail}</p>
                                                </div>
                                            </div>
                                            <div className="details-div">
                                                <p>Gift Amount</p>
                                                <p>{data.attributes.amount}</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            ))}
                        </div>
                    </div>
                </div>
            </div>
        </Fragment>
    )
}

export default MyGiftCard;