"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 (