"use client"; import { useState } from "react"; import { Search } from "lucide-react"; import { MapCard, type CardMap } from "./MapCard"; export function CatalogBrowser({ maps }: { maps: CardMap[] }) { const [query, setQuery] = useState(""), [source, setSource] = useState("all"); const shown = maps.filter( (m) => (source === "all" || m.source === source) && (m.name + " " + m.description + " " + (m.server?.name ?? "")) .toLowerCase() .includes(query.trim().toLowerCase()), ); return ( <>
{shown.length} {shown.length === 1 ? "world" : "worlds"} to explore
No worlds match that search.
)} > ); }