import { useState, useMemo, useRef } from "react"; import { motion, useInView } from "framer-motion"; import { Search, Download, FileText, Calendar, Filter } from "lucide-react"; import { Input } from "./ui/input"; import { Button } from "./ui/button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "./ui/dialog"; import { Badge } from "./ui/badge"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select"; interface ResearchPaper { id: string; title: string; authors: string; date: string; category: string; abstract: string; downloadUrl: string; } const researchPapers: ResearchPaper[] = [ { id: "1", title: "Advanced Cryogenic Preservation Techniques for Leafy Vegetables", authors: "Dr. Sarah Johnson, Dr. Michael Chen", date: "2024-01-15", category: "Vegetables", abstract: "This study explores novel cryogenic preservation methods that extend the shelf life of leafy vegetables by up to 400% while maintaining nutritional integrity. Our findings demonstrate significant improvements in chlorophyll retention and texture preservation.", downloadUrl: "#", }, { id: "2", title: "Controlled Atmosphere Storage: Optimizing Fruit Hibernation", authors: "Dr. Emily Rodriguez, Dr. James Park", date: "2023-11-20", category: "Fruits", abstract: "An in-depth analysis of controlled atmosphere storage parameters for various fruit types. This research identifies optimal oxygen, carbon dioxide, and humidity levels for maximum preservation efficacy.", downloadUrl: "#", }, { id: "3", title: "Enzymatic Activity Suppression in Root Vegetables During Storage", authors: "Dr. Robert Williams, Dr. Lisa Anderson", date: "2023-09-10", category: "Vegetables", abstract: "Investigation into natural enzymatic inhibitors that prevent degradation in root vegetables during extended storage periods. Results show promise for organic preservation methods.", downloadUrl: "#", }, { id: "4", title: "Temperature Gradient Management in Berry Preservation", authors: "Dr. Amanda Foster, Dr. Kevin Liu", date: "2023-07-05", category: "Fruits", abstract: "This paper examines the impact of precise temperature gradient control on berry preservation, revealing optimal cooling rates and storage temperatures for different berry varieties.", downloadUrl: "#", }, { id: "5", title: "Microbiome Stabilization in Organic Produce Storage", authors: "Dr. Patricia Martinez, Dr. David Thompson", date: "2023-05-18", category: "General", abstract: "Comprehensive study on maintaining beneficial microbiomes while suppressing pathogenic organisms during produce storage, with implications for organic farming practices.", downloadUrl: "#", }, { id: "6", title: "Humidity Control Systems for Tropical Fruit Preservation", authors: "Dr. Carlos Mendez, Dr. Jennifer Wong", date: "2023-03-22", category: "Fruits", abstract: "Analysis of advanced humidity control technologies and their effectiveness in preserving tropical fruits during long-distance transportation and storage.", downloadUrl: "#", }, ]; export default function ResearchSection() { const [searchQuery, setSearchQuery] = useState(""); const [selectedCategory, setSelectedCategory] = useState("all"); const [selectedPaper, setSelectedPaper] = useState(null); const ref = useRef(null); const isInView = useInView(ref, { once: true, margin: "-100px" }); const filteredPapers = useMemo(() => { return researchPapers.filter((paper) => { const matchesSearch = paper.title.toLowerCase().includes(searchQuery.toLowerCase()) || paper.authors.toLowerCase().includes(searchQuery.toLowerCase()) || paper.abstract.toLowerCase().includes(searchQuery.toLowerCase()); const matchesCategory = selectedCategory === "all" || paper.category === selectedCategory; return matchesSearch && matchesCategory; }); }, [searchQuery, selectedCategory]); const categories = ["all", ...Array.from(new Set(researchPapers.map((p) => p.category)))]; return (

Research & Publications

Explore our comprehensive library of peer-reviewed research papers

{/* Search and Filter */}
setSearchQuery(e.target.value)} className="pl-10 h-12 text-base" />
{/* Results Count */} Showing {filteredPapers.length} of {researchPapers.length} papers {/* Papers Grid */}
{filteredPapers.map((paper, index) => ( setSelectedPaper(paper)} >
{paper.category}

{paper.title}

{paper.authors}

{new Date(paper.date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })}

{paper.abstract}

))}
{filteredPapers.length === 0 && (

No papers found matching your search criteria.

)} {/* Paper Preview Modal */} setSelectedPaper(null)}> {selectedPaper && ( <> {selectedPaper.title} {selectedPaper.authors}
{selectedPaper.category}
{new Date(selectedPaper.date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })}

Abstract

{selectedPaper.abstract}

)}
); }