Knowledge Hub
Explore our collection of articles, guides, and resources to help you grow better.
Featured Articles
{blog.title}
Browse by Topic
No articles found
Try adjusting your search or filter to find what you're looking for.
"use client"; import { useState } from "react"; import Link from "next/link"; import Image from "next/image"; import { CalendarIcon, ChevronRight, Leaf, Search } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; // Sample blog data const blogs = [ { id: 1, title: "Sustainable Farming Practices for Modern Agriculture", description: "Learn about eco-friendly farming techniques that can increase yield while preserving the environment.", date: "2023-05-15", author: "Emma Johnson", topic: "Sustainability", image: "/placeholder.svg?height=400&width=600", readTime: "5 min read", featured: true, }, { id: 2, title: "Optimizing Fertilizer Usage for Maximum Crop Yield", description: "Discover the perfect balance of fertilizers to maximize your harvest without wasting resources.", date: "2023-06-02", author: "Michael Chen", topic: "Fertilizers", image: "/placeholder.svg?height=400&width=600", readTime: "7 min read", featured: false, }, { id: 3, title: "Seasonal Planting Guide: What to Grow and When", description: "A comprehensive guide to help you plan your planting schedule throughout the year for optimal results.", date: "2023-06-18", author: "Sarah Williams", topic: "Plantation", image: "/placeholder.svg?height=400&width=600", readTime: "8 min read", featured: false, }, { id: 4, title: "Water Conservation Techniques for Drought-Prone Areas", description: "Essential strategies to maintain your crops during water shortages and drought conditions.", date: "2023-07-05", author: "David Rodriguez", topic: "Sustainability", image: "/placeholder.svg?height=400&width=600", readTime: "6 min read", featured: false, }, { id: 5, title: "Organic Pest Control Methods That Actually Work", description: "Natural and effective ways to keep pests at bay without resorting to harmful chemicals.", date: "2023-07-22", author: "Lisa Thompson", topic: "Organic", image: "/placeholder.svg?height=400&width=600", readTime: "9 min read", featured: false, }, { id: 6, title: "The Future of Smart Farming: IoT and Agriculture", description: "How Internet of Things technology is revolutionizing the way we monitor and manage farms.", date: "2023-08-10", author: "James Wilson", topic: "Technology", image: "/placeholder.svg?height=400&width=600", readTime: "10 min read", featured: true, }, ]; // Extract unique topics from blogs const topics = ["All", ...new Set(blogs.map((blog) => blog.topic))]; export default function KnowledgeHubPage() { const [selectedTopic, setSelectedTopic] = useState("All"); const [searchQuery, setSearchQuery] = useState(""); // Filter blogs based on selected topic and search query const filteredBlogs = blogs.filter((blog) => { const matchesTopic = selectedTopic === "All" || blog.topic === selectedTopic; const matchesSearch = blog.title.toLowerCase().includes(searchQuery.toLowerCase()) || blog.description.toLowerCase().includes(searchQuery.toLowerCase()); return matchesTopic && matchesSearch; }); // Get featured blogs const featuredBlogs = blogs.filter((blog) => blog.featured); return (
Explore our collection of articles, guides, and resources to help you grow better.
Try adjusting your search or filter to find what you're looking for.