"use client"; import { useState } from "react"; import Link from "next/link"; import { Puzzle, ChevronRight, Search, X } from "lucide-react"; import { useSkills } from "@/lib/hooks"; import type { SkillSummary } from "@/lib/types"; export default function SkillsPage() { const { data, isLoading } = useSkills(); const [search, setSearch] = useState(""); const skills = data?.skills || []; const categories = [...new Set(skills.map((s) => s.category || "uncategorized"))].sort(); const filtered = search ? skills.filter( (s) => s.name.toLowerCase().includes(search.toLowerCase()) || s.description.toLowerCase().includes(search.toLowerCase()) ) : skills; const grouped = categories .map((cat) => ({ category: cat, skills: filtered.filter((s) => (s.category || "uncategorized") === cat), })) .filter((g) => g.skills.length > 0); return (

Skills

{skills.length} total
setSearch(e.target.value)} placeholder="Filter skills..." className="w-full pl-9 pr-9 py-2.5 rounded-xl text-sm bg-white/[0.04] border border-white/[0.08] text-zinc-200 placeholder-zinc-600 outline-none focus:border-white/[0.15] transition-colors" /> {search && ( )}
{isLoading ? (
{[...Array(5)].map((_, i) => (
))}
) : (
{grouped.map(({ category, skills }) => (

{category}

{skills.map((s) => ( ))}
))} {grouped.length === 0 && (
No skills match “{search}”
)}
)}
); } function SkillRow({ skill }: { skill: SkillSummary }) { return (
{skill.name}
{skill.description}
); }