TabContentSection.js
1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import React from "react";
import Link from "next/link";
import { Tab, Tabs, TabList, TabPanel, resetIdCounter } from "react-tabs";
import Image from "next/image";
const TabContentSection = ({
  sectionTitle,
  sectionSubtitle,
  tabData,
  mainImage,
  shapeImage,
  buttonText,
  buttonLink,
}) => {
  return (
    <>
      <div className="what-we-do-area ptb-100">
        <div className="container">
          <div className="row align-items-center">
            <div className="col-lg-6 col-md-12">
              <div className="what-we-do-image">
                <Image
                  src={mainImage}
                  alt="main"
                  layout="fill"
                  className="img-fluid image"
                />
                <Image
                  src={shapeImage}
                  alt="shape"
                  layout="fill"
                  className=" shape img-fluid image"
                />
              </div>
            </div>
            <div className="col-lg-6 col-md-12">
              <div className="what-we-do-content">
                <span className="sub-title">{sectionSubtitle}</span>
                <h2>{sectionTitle}</h2>
                <Tabs>
                  <TabList>
                    {tabData.map((tab, index) => (
                      <Tab key={index}>{tab.tabTitle}</Tab>
                    ))}
                  </TabList>
                  {tabData.map((tab, index) => (
                    <TabPanel key={index}>
                      <p>{tab.content}</p>
                    </TabPanel>
                  ))}
                </Tabs>
                <Link href={buttonLink} className="default-btn">
                  {buttonText} <i className="ri-arrow-right-line"></i>
                </Link>
              </div>
            </div>
          </div>
        </div>
      </div>
    </>
  );
};
export default TabContentSection;