import AppLayout from '@/Layouts/AppLayout'; import { Head, router } from '@inertiajs/react'; import { BookOpen, Plus, FileText, Folder, Upload, Search } from 'lucide-react'; import { GlassCard } from '@/Components/ui/GlassCard'; import { Button } from '@/Components/ui/Button'; import { motion } from 'framer-motion'; import { timeAgo } from '@/lib/utils'; import { useState } from 'react'; export default function WikiIndex({ spaces, recent_pages, files }) { const [search, setSearch] = useState(''); const filtered = (recent_pages ?? []).filter(p => p.title.toLowerCase().includes(search.toLowerCase()) ); return (

Wiki & Documents

Centralized documentation, runbooks, and files

{/* Search */}
setSearch(e.target.value)} placeholder="Search pages, documents..." className="w-full pl-12 pr-4 py-3 bg-white/5 border border-white/10 rounded-xl text-sm text-white placeholder:text-white/20 focus:outline-none focus:border-cyan-500/50 transition-all" />
{/* Spaces */}

Spaces

{(spaces ?? []).map(space => (

{space.name}

{space.pages_count ?? 0} pages

))} {(!spaces || spaces.length === 0) && (

No spaces yet

)}
{/* Recent Pages */}

{search ? `Search: "${search}"` : 'Recent Pages'}

{filtered.map(page => (

{page.title}

{page.space?.name}

ยท

Updated {timeAgo(page.updated_at)}

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

{search ? 'No pages match your search' : 'No pages yet. Create your first page!'}

)}
); }