home page tab services section updated
This commit is contained in:
parent
f7d99102af
commit
caefb48d4c
@ -4,13 +4,14 @@ import classnames from "classnames";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { TabServices } from "../../utils/constant.utils"; // JSON array
|
||||
import Campaign from "../../api/campaign";
|
||||
|
||||
const ClickHandler = () => {
|
||||
window.scrollTo(10, 0);
|
||||
};
|
||||
|
||||
// Extract unique categories from the JSON dynamically
|
||||
const categories = [...new Set(TabServices.map((service) => service.category))];
|
||||
const categories = [...new Set(Campaign.map((service) => service.category))];
|
||||
|
||||
const ServiceSectionS2 = () => {
|
||||
const [activeTab, setActiveTab] = useState(categories[0]);
|
||||
@ -42,7 +43,7 @@ const ServiceSectionS2 = () => {
|
||||
{categories.map((cat, idx) => (
|
||||
<TabPane tabId={cat} key={idx}>
|
||||
<Row>
|
||||
{TabServices.filter((srv) => srv.category === cat).map(
|
||||
{Campaign.filter((srv) => srv.category === cat).slice(0,3).map(
|
||||
(service, srvIdx) => (
|
||||
<div className="col-lg-4 col-md-6 col-12" key={srvIdx}>
|
||||
<div className="wpo-campaign-single">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user