diff --git a/src/pages/Category.tsx b/src/pages/Category.tsx new file mode 100644 index 0000000..354d7bf --- /dev/null +++ b/src/pages/Category.tsx @@ -0,0 +1,174 @@ +import { Link, useParams } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { + ArrowRight, ChevronLeft, ChevronRight, Clock +} from "lucide-react"; +import Header from "@/components/Header"; +import Footer from "@/components/Footer"; + +const categoryColors: Record = { + Technology: "bg-emerald-100 text-emerald-700", + Design: "bg-amber-100 text-amber-700", + Business: "bg-stone-200 text-stone-700", + Lifestyle: "bg-teal-100 text-teal-700", +}; + +const categoryInfo: Record = { + technology: { description: "Deep dives into software development, web technologies, AI, and the tools shaping the future of tech.", count: 42 }, + design: { description: "Exploring visual design, UX principles, design systems, and the art of crafting beautiful interfaces.", count: 28 }, + business: { description: "Insights on startups, product strategy, growth, and the business side of technology.", count: 19 }, + lifestyle: { description: "Productivity tips, remote work culture, career advice, and life as a tech professional.", count: 15 }, +}; + +const articles = [ + { id: 1, title: "Understanding React Server Components in Production", excerpt: "A practical guide to adopting RSC in existing React applications.", category: "Technology", author: "Sarah Chen", initials: "SC", date: "Mar 12, 2025", gradient: "from-amber-200 to-orange-300", slug: "react-server-components" }, + { id: 2, title: "TypeScript Best Practices for Large Codebases", excerpt: "Type-safe patterns and architectural decisions that pay off at scale.", category: "Technology", author: "James Liu", initials: "JL", date: "Mar 6, 2025", gradient: "from-emerald-200 to-teal-300", slug: "typescript-best-practices" }, + { id: 3, title: "Edge Functions: A Practical Introduction", excerpt: "How edge computing changes the way we deploy and run web applications.", category: "Technology", author: "Sarah Chen", initials: "SC", date: "Mar 1, 2025", gradient: "from-stone-200 to-stone-400", slug: "edge-functions-intro" }, + { id: 4, title: "The State of WebAssembly in 2025", excerpt: "Where Wasm stands today and where it is heading for web developers.", category: "Technology", author: "Aisha Patel", initials: "AP", date: "Feb 25, 2025", gradient: "from-amber-100 to-amber-300", slug: "webassembly-2025" }, + { id: 5, title: "Building Real-Time Apps with Server-Sent Events", excerpt: "A simpler alternative to WebSockets for many real-time use cases.", category: "Technology", author: "Marcus Rivera", initials: "MR", date: "Feb 20, 2025", gradient: "from-emerald-100 to-emerald-300", slug: "server-sent-events" }, + { id: 6, title: "Modern CSS Layout Patterns You Should Know", excerpt: "Container queries, subgrid, and other CSS features transforming layout.", category: "Technology", author: "David Kim", initials: "DK", date: "Feb 15, 2025", gradient: "from-stone-100 to-amber-200", slug: "modern-css-layout" }, +]; + +const allCategories = ["Technology", "Design", "Business", "Lifestyle"]; + +export default function CategoryPage() { + const { name } = useParams(); + const categoryName = name ? name.charAt(0).toUpperCase() + name.slice(1) : "Technology"; + const info = categoryInfo[name || "technology"] || categoryInfo.technology; + + return ( +
+
+ + {/* Category Hero */} +
+
+ +
+ + {categoryName} + +
+
+

{categoryName}

+

{info.description}

+
+ {info.count} articles +
+
+
+ Latest + | + Popular + | + Oldest +
+
+
+
+
+ + {/* Articles + Sidebar */} +
+
+
+ {/* Articles Grid */} +
+
+ {articles.map((article) => ( + + +
+
+
+
+ +

+ {article.title} +

+

{article.excerpt}

+
+ {article.date} + · + 5 min read +
+
+
+ {article.initials} +
+ {article.author} +
+
+ + + ))} +
+ + {/* Pagination */} +
+ + {[1, 2, 3, 4, 5].map((page) => ( + + ))} + +
+
+ + {/* Sidebar */} +
+ + +

All Categories

+
    + {allCategories.map((cat) => ( +
  • + + + {cat} + + {categoryInfo[cat.toLowerCase()]?.count || 0} + + +
  • + ))} +
+
+
+
+
+
+
+ +
+ ); +}