"use client"; import { useI18n } from "@/components/I18nProvider"; import { useState } from "react"; import { Search } from "lucide-react"; import { MapCard, type CardMap } from "./MapCard"; import { ImportMap } from "./MapTransfer"; export function CatalogBrowser({ maps, signedIn = false, }: { maps: CardMap[]; signedIn?: boolean; }) { 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 && (
)} ); }