'use client'; import { useState, useEffect, use } from 'react'; import Link from 'next/link'; import { getPrompts } from '@/lib/actions/promptActions'; import { Search, Sparkles, Copy, Check, Terminal, ArrowRight, Tag } from 'lucide-react'; export default function PromptsPage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = use(params); const [search, setSearch] = useState(''); const [selectedCategory, setSelectedCategory] = useState(null); const [prompts, setPrompts] = useState([]); const [loading, setLoading] = useState(true); const [copiedId, setCopiedId] = useState(null); useEffect(() => { async function loadData() { setLoading(true); const res = await getPrompts({ query: search, category: selectedCategory || undefined }); setPrompts(res); setLoading(false); } loadData(); }, [search, selectedCategory]); const handleCopy = async (id: string, content: string) => { try { await navigator.clipboard.writeText(content); setCopiedId(id); setTimeout(() => setCopiedId(null), 2000); } catch (err) { console.error('Failed to copy prompt:', err); } }; const categories = Array.from(new Set(prompts.map((p) => p.category))); return (
{/* Page Header */}
Curated AI System Prompts & Templates

AI Prompts & Agent Templates Library

Battle-tested system prompts, coding instructions, and LLM templates for ChatGPT, Claude, and Gemini agents.

{/* Search & Filter Bar */}
{/* Search Input */}
setSearch(e.target.value)} className="w-full bg-slate-950 border border-slate-800 rounded-xl pl-10 pr-4 py-2 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-red-500/50" />
{/* Category Filter Pills */}
{categories.map((cat) => ( ))}
{/* Prompts Grid */} {loading ? (
Loading data...
) : prompts.length > 0 ? (
{prompts.map((item) => (
{item.category}
{item.tags?.join(', ')}

{item.title}

{item.description}

{/* Prompt Code Preview Box */}
                    {item.content}
                  
View Full Prompt & Usage
))}
) : (
No prompts found matching your search.
)}
); }