import Navbar from "../Layout/Navbar"; import bghero1 from "../assets/hero2about.png"; import bghero2 from "../assets/hero1about.png"; import bghero3 from "../assets/hero3about.png"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; import Footer from "../Layout/Footer"; import { useEffect } from "react"; const missions = [ "Becoming the science and technology excellent center in the field of embedded sensor systems to support biomedical applications based on the Internet of Things (IoT).", "Becoming the science and technology excellent center on development remote health monitoring systems based on Internet of Things (IoT).", "Becoming the science and technology excellent center on Big Data Analytic.", "Becoming the science and technology excellent center on health development of Information and Communication Technology (ICT).", ]; const AboutUs = () => { const [currentIndex, setCurrentIndex] = useState(0); const [currentPage, setCurrentPage] = useState(1); const itemsPerPage = 8; const [partners, setPartners] = useState([]); const [hasPartner, setHasPartner] = useState(true); const [researchProducts, setResearchProducts] = useState( [] ); type Partner = { id: number; nama_partner: string; image_path: string; }; type ResearchProduct = { id: number; nama_project: string; image_path: string; }; const slides = [ { image: bghero1, title: "About Us", description: "Research Center Human Centric Engineering (RC HUMIC), merupakan pusat penelitian Telkom University yang berfokus pada pengembangkan rekayasa teknologi yang berkaitan dengan dukungan aktivitas manusia sehari-hari seperti bidang komputasi, informatika, elektronika, robotik, mekanikal, dan teknik biomedis.", }, { image: bghero2, title: "Visi", description: "To become an excellent research center in the field of engineering to improve the human health and prosperity", }, { image: bghero3, title: "Misi", description: "1. Becoming the science and technology excellent center in the field of embedded sensor systems to support biomedical applications based on the Internet of Things (IoT). 2. Becoming the science and technology excellent center on development remote health monitoring systems based on Internet of Things (IoT).", }, ]; const prevSlide = () => { setCurrentIndex((prev) => (prev === 0 ? slides.length - 1 : prev - 1)); }; const nextSlide = () => { setCurrentIndex((prev) => (prev === slides.length - 1 ? 0 : prev + 1)); }; const currentSlide = slides[currentIndex]; const indexOfLastItem = currentPage * itemsPerPage; const indexOfFirstItem = indexOfLastItem - itemsPerPage; const currentProducts = researchProducts.slice( indexOfFirstItem, indexOfLastItem ); const totalPages = Math.ceil(researchProducts.length / itemsPerPage); const navigate = useNavigate(); useEffect(() => { fetch(`${import.meta.env.VITE_API_BASE_URL}/hasil-research-api/get`) .then((res) => res.json()) .then((data) => { setResearchProducts(data.data); }) .catch((error) => { console.error("Gagal mengambil data hasil research:", error); }); }, []); useEffect(() => { fetch(`${import.meta.env.VITE_API_BASE_URL}/partnership-api/get`) .then((res) => res.json()) .then((data) => { if (data.message === "No partnership data") { setHasPartner(false); } else { setPartners(data.data); setHasPartner(true); } }) .catch((error) => { console.error("Failed to fetch partnership data:", error); setHasPartner(false); }); }, []); return (
{/* Navbar Section */}
{/* Hero Section 1 */}
{/* Overlay */}
{/* Content */}

{currentSlide.title}

{/* Mission Control */} {currentSlide.title === "Misi" ? (
    {missions.map((mission, index) => (
  1. {mission}
  2. ))}
) : (

{currentSlide.description}

)}
{/* Arrow Controls */}
{/* Hero Section 2 Partnership */} {hasPartner && (

Partnership

Kami bersama-sama menciptakan solusi yang memberdayakan bisnis dan meningkatkan efisiensi operasional.

{partners.map((partner) => ( {`Partnership ))}
)} {/* Hero section 3 */}

Hasil Produk Research

{/* Hero section 3 content */}
{currentProducts.map((item) => (
navigate(`/details-product/${item.id}`)} > {item.nama_project}

{item.nama_project}

))}
); }; export default AboutUs;