import React, { useState } from "react"; import { TabContent, TabPane, Nav, NavItem, NavLink, Row } from "reactstrap"; import classnames from "classnames"; import Link from "next/link"; import Image from "next/image"; import { useTranslation } from "next-i18next"; const ClickHandler = () => { window.scrollTo(0, 0); }; const ServiceSectionS2 = () => { const { t } = useTranslation("services"); // Assuming your translations are in services.json // Get campaigns array from the translation JSON const campaigns = t("campaigns", { returnObjects: true }); // Extract unique categories from the campaigns dynamically const categories = [...new Set(campaigns.map((service) => service.category))]; // Default active tab is the first category const [activeTab, setActiveTab] = useState(categories[0]); const toggle = (tab) => { if (activeTab !== tab) setActiveTab(tab); }; return (
100 ? service.description.substring(0, 100) + '...' : service.description, }} >