"use client"; import { useI18n } from "@/components/I18nProvider"; import { useState } from "react"; import { Search } from "lucide-react"; import { MapCard, type CardMap } from "./MapCard"; export function CatalogBrowser({ maps }: { maps: CardMap[] }) { const { t } = useI18n(); 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 ( <>
{[ ["all", t("All worlds")], ["plugin", t("Server exports")], ["fabric", t("Player captures")], ].map(([id, label]) => ( ))}

{t("Worlds to explore: {count}", { count: shown.length })}

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

{t("No worlds match that search.")}

)} ); }