VendorDetails.js 8.79 KB
import React, { Fragment, useState } from "react"
import { Button, Table } from "react-bootstrap";
import { FaAngleLeft, FaArrowLeft } from "react-icons/fa";
import ActivityDetailsModal from "./ActivityDetailsModal";
import Image from "next/image";
import RejectModal from "./RejectModal";

const VendorDetails = ({ id, backClick }) => {
    const [showActivityDetailsModal, setShowActivityDetailsModal] = useState(false);
    const [showRejectModal, setShowRejectModal] = useState(false);
    const handleShowActivityDetails = () => {
        setShowActivityDetailsModal(true)
    }
    const handleCloseActivityDetails = () => {
        setShowActivityDetailsModal(false)
    }
    const handleShowRejectModal = () => {
        setShowRejectModal(true)
    }
    const handleCloseRejectModal = () => {
        setShowRejectModal(false)
    }

    return (
        <Fragment>
            <div className="vendorDetails">
                <div className="row">
                    <div className="col-12 col-lg-12">
                        <div className="d-flex align-items-center justify-content-between">
                            <div className="backDiv">
                                <span className="backArrow" onClick={backClick}><FaAngleLeft /></span>
                                <span>Vendors List</span>
                            </div>
                            <div className="d-flex">
                                <Button variant="" className="btnAdd btnApprove my-0 me-2">
                                    Approve
                                </Button>
                                <Button variant="" className="btnAdd btnReject m-0" onClick={handleShowRejectModal}>
                                    Reject
                                </Button>
                            </div>
                        </div>
                    </div>
                    <div className="col-12 col-lg-12 mt-4">
                        <h4>Business Information</h4>
                        <div className="row">
                            <div className="col-12 col-lg-4">
                                <p className="phead">Business Documents</p>
                                <div className="row">
                                    <p className="col-12 col-lg-6">Business PAN No.</p>
                                    <p className="col-12 col-lg-6">BQYOG5528T</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-6">PAN</p>
                                    <p className="col-12 col-lg-6 pview">View</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-6">GST Number</p>
                                    <p className="col-12 col-lg-6">27AAGFL7781K2AX</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-6">GST Certificate</p>
                                    <p className="col-12 col-lg-6 pview">View</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-6">Business Name</p>
                                    <p className="col-12 col-lg-6">M S Adventures</p>
                                </div>
                            </div>
                            <div className="col-12 col-lg-5 borderLeft">
                                <p className="phead">Business Address</p>
                                <div className="row">
                                    <p className="col-12 col-lg-4">Pincode</p>
                                    <p className="col-12 col-lg-8">91006</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-4">Country</p>
                                    <p className="col-12 col-lg-8">United States</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-4">State</p>
                                    <p className="col-12 col-lg-8">California</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-4">City</p>
                                    <p className="col-12 col-lg-8">Los Angeles</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-4">Address Line 1</p>
                                    <p className="col-12 col-lg-8">5396 North Reese Avenue, Fresno</p>
                                </div>
                                <div className="row">
                                    <p className="col-12 col-lg-4">Address Line 2</p>
                                    <p className="col-12 col-lg-8">N/A</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div className="col-12 col-lg-12 mt-4">
                        <h4 className="mb-1">Activities</h4>
                        <Table responsive className="listingTable">
                            <thead>
                                <tr>
                                    <th>
                                        <label className="check-container mb-0 ps-2" htmlFor="checkh">
                                            <input
                                                type="checkbox"
                                                id="checkh"
                                                className="check-box"
                                            />
                                            <span className="checkmark"></span>
                                        </label>
                                    </th>
                                    <th>Category</th>
                                    <th>Sub Category</th>
                                    <th>Name</th>
                                    <th>Location</th>
                                    <th>Price</th>
                                    <th>Place</th>
                                    <th>Gift</th>
                                    <th></th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                                {[1, 2].map((data, index) => (
                                    <tr key={index}>
                                        <td>
                                            <label className="check-container mb-0 ps-2" htmlFor={`check${index}`}>
                                                <input
                                                    type="checkbox"
                                                    id={`check${index}`}
                                                    className="check-box"
                                                />
                                                <span className="checkmark"></span>
                                            </label>
                                        </td>
                                        <td><span onClick={handleShowActivityDetails}>Adventure</span></td>
                                        <td>Ice-Skating</td>
                                        <td>Ice-Skating in NY</td>
                                        <td>North Avenue</td>
                                        <td>$ 479</td>
                                        <td>Outdoor</td>
                                        <td>Allowed</td>
                                        <td><Image alt="" width={20} height={20} src="/images/vendor/icon-view.svg" /></td>
                                        <td><Image alt="" width={20} height={20} src="/images/vendor/icon-more-vertical.svg" /></td>
                                    </tr>
                                ))}
                                <tr>
                                    <td colSpan={10}>Showing Results 10 of 1567</td>
                                </tr>
                            </tbody>
                        </Table>
                    </div>
                </div>
            </div>

            {showActivityDetailsModal && (
                <ActivityDetailsModal show={showActivityDetailsModal} handleClose={handleCloseActivityDetails} />
            )}

            {showRejectModal && (
                <RejectModal show={showRejectModal} handleClose={handleCloseRejectModal} />
            )}

        </Fragment>
    )
}
export default VendorDetails;