"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.toLowerCase()), ); return ( <>
{[ ["all", "All worlds"], ["plugin", "Server exports"], ["fabric", "Player captures"], ].map(([id, label]) => ( ))}

{shown.length} {shown.length === 1 ? "world" : "worlds"} to explore

{shown.map((m, i) => ( ))}
{!shown.length && (

No worlds match that search.

)} ); }