SubMenu.js 3.24 KB
import Image from 'next/image'
import Link from 'next/link'
import React from 'react'
import { Col, Row } from 'react-bootstrap'
import { cleanImage } from '../imageHandling'

export const SubMenu = ({ data, menuTitle }) => {
    // console.log(data, 'menudata');


    const { classname, headerLeft, headerRight } = data;



    return (
        <section className='submenu_header_desktop'>
            <div className='custom_container'>
                <Row className='justify-content-between'>
                    <div className={classname}>
                        <Row>
                            <p className='nav_title'>{menuTitle}</p>
                            {
                                headerLeft && headerLeft.map((item, index) => (
                                    <div className={`nav_item ${item?.classname}`} key={index}>
                                        <a className='text-decoration-none' href={item?.btnTextUrl}>
                                            <h4>{item?.title}</h4>
                                            <p>{item?.description}</p>
                                            {
                                                item?.btnText && (
                                                    <a className='btn btn-primary' href={item?.btnTextUrl}>{item?.btnText}</a>
                                                )
                                            }
                                        </a>
                                    </div>
                                ))
                            }
                        </Row>
                    </div>
                    {
                        !headerRight?.hideRightSection && (
                            <>
                                <Col md={1}>
                                    <div className='border_right'></div>
                                </Col>
                                <div className={`best_seller ${headerRight?.classname}`}>
                                    <a href={headerRight?.btnTextUrl}>
                                        <Image src={cleanImage(headerRight?.image?.url)} width={1000} height={1000} className='img-fluid position-relative' alt='header image' />
                                        <Row>
                                            <div className='col-xxl-6 col-md-8 best_seller_card'>
                                                <h3>{headerRight?.title}</h3>
                                                <span className='badge bg-white'>
                                                    <strong>{headerRight?.tag.split(' ')[0]}</strong> {headerRight?.tag.split(' ').slice(1).join(' ')}
                                                </span>
                                                <p>{headerRight?.description}</p>
                                            </div>
                                        </Row>
                                        <h4>{headerRight?.subTitle}</h4>
                                        <p>{headerRight?.subDescription}</p>
                                    </a>
                                </div>
                            </>
                        )
                    }
                </Row>
            </div>
        </section>
    )
}