"use client" import { useState } from "react" import Link from "next/link" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Input } from "@/components/ui/input" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Cpu, BookOpen, Play, Clock, Wrench, Zap, Shield, Search, CheckCircle, ArrowLeft, Upload } from "lucide-react" import { type PerformanceCategory, performanceCategories } from "@/lib/mock-data" const buildGuides = [ { id: "pc-assembly-guide", title: "Complete PC Assembly Guide", description: "Step-by-step guide for building your PC from scratch with detailed visuals and instructions. Perfect for beginners!", difficulty: "Beginner", duration: "2-3 hours", views: "0", category: "Setup", performanceCategory: "all" as PerformanceCategory, image: "/1st.png", steps: 12, tools: ["Screwdriver (magnetic tip)", "Thermal paste", "Anti-static wrist strap", "Motherboard manual"], estimatedCost: "₱44,000-66,000", tags: ["guide"], }, { id: "pc-first-boot-setup", title: "PC First Boot & Setup Guide", description: "Learn how to safely boot your newly built PC, configure BIOS, install Windows, and set up essential drivers", difficulty: "Beginner", duration: "45-60 minutes", views: "0", category: "Setup", performanceCategory: "all" as PerformanceCategory, image: "/boot-guide.png", steps: 13, tools: ["USB flash drive (8GB+)", "Internet connection"], estimatedCost: "Free", tags: ["setup", "bios", "windows"], }, { id: "budget-office-pc", title: "Budget Office PC Build", description: "Build an efficient and affordable PC for office work, web browsing, and basic productivity tasks", difficulty: "Beginner", duration: "2-3 hours", views: "0", category: "Office", performanceCategory: "office" as PerformanceCategory, image: "/budget-office-computer.jpg", steps: 6, tools: ["Screwdriver (magnetic tip)", "Thermal paste", "Anti-static wrist strap", "Motherboard manual"], estimatedCost: "₱22,000-33,000", tags: ["budget", "office"], }, { id: "budget-gaming-build", title: "Best 700$ Gaming PC Build Guide", description: "An excellent build for 1080p gaming and you can stream to twitch or youtube", difficulty: "Beginner", duration: "2-3 hours", views: "0", category: "Gaming", performanceCategory: "gaming" as PerformanceCategory, image: "/gaming-pc-build-guide.png", steps: 9, tools: ["Screwdriver (magnetic tip)", "Thermal paste", "Anti-static wrist strap", "Motherboard manual"], estimatedCost: "₱82,500-137,500", tags: ["budget", "gaming"], }, ] const quickTips = [ { icon: Wrench, title: "Essential Tools", description: "What you need before starting your build", tips: ["Phillips head screwdriver", "Anti-static wrist strap", "Good lighting", "Clean workspace"], }, { icon: Zap, title: "Safety First", description: "Protect your components from static damage", tips: ["Ground yourself regularly", "Work on hard surfaces", "Avoid carpeted areas", "Handle components by edges"], }, { icon: Shield, title: "Cable Management", description: "Keep your build clean and improve airflow", tips: [ "Plan cable routes first", "Use zip ties sparingly", "Route behind motherboard tray", "Leave room for airflow", ], }, ] export default function GuidesPage() { const [searchTerm, setSearchTerm] = useState("") const [selectedPerformanceCategory, setSelectedPerformanceCategory] = useState("all") const [selectedDifficulty, setSelectedDifficulty] = useState("all") const [sortBy, setSortBy] = useState("popular") const getFilteredGuides = () => { const filtered = buildGuides.filter((guide) => { const matchesSearch = guide.title.toLowerCase().includes(searchTerm.toLowerCase()) || guide.description.toLowerCase().includes(searchTerm.toLowerCase()) || guide.tags.some((tag) => tag.toLowerCase().includes(searchTerm.toLowerCase())) const matchesPerformanceCategory = selectedPerformanceCategory === "all" || guide.performanceCategory === selectedPerformanceCategory const matchesDifficulty = selectedDifficulty === "all" || guide.difficulty.toLowerCase() === selectedDifficulty return matchesSearch && matchesPerformanceCategory && matchesDifficulty }) // Sort guides switch (sortBy) { case "newest": return filtered.sort((a, b) => new Date(b.lastUpdated).getTime() - new Date(a.lastUpdated).getTime()) case "rating": return filtered.sort((a, b) => b.rating - a.rating) case "duration": return filtered.sort((a, b) => a.duration.localeCompare(b.duration)) default: // popular return filtered.sort( (a, b) => Number.parseInt(b.views.replace("k", "000")) - Number.parseInt(a.views.replace("k", "000")), ) } } const filteredGuides = getFilteredGuides() return (
{/* Top bar: back + submit */}
{/* Page Header */}

Build Guides

Step-by-step tutorials to help you build your perfect PC with confidence

{buildGuides.length} guides available
{/* Quick Tips — blue accent cards */}
{quickTips.map((tip, index) => (
{tip.title} {tip.description}
    {tip.tips.map((tipItem, tipIndex) => (
  • {tipItem}
  • ))}
))}
{/* Search & filters — blue-accent panel */}

Search & filters

setSearchTerm(e.target.value)} />
{/* All Guides */}

{selectedPerformanceCategory === "all" ? "All Guides" : `${performanceCategories[selectedPerformanceCategory]?.name ?? "Category"} Guides`}

{filteredGuides.length} guide{filteredGuides.length !== 1 ? "s" : ""} found
{filteredGuides.map((guide) => (
{guide.title}
{performanceCategories[guide.performanceCategory]?.name ?? guide.category} {guide.difficulty}
{guide.title} {guide.description}
{guide.duration}
{guide.steps} steps
{guide.tools.length} tools
{guide.tags.slice(0, 3).map((tag) => ( {tag} ))}
))}
{filteredGuides.length === 0 && (

No guides match your filters

Try different search terms or clear the category and difficulty filters.

)}
{/* CTA */}

Ready to start building?

Use the PC Builder to pick compatible parts and get real-time compatibility checking.

) }