import { useSearchParams } from "react-router-dom";
import { AssetStreamPage } from "../../components/AssetStreamPage";
import { useI18n } from "../../i18n";

export function Browse() {
  const { t } = useI18n();
  const [sp] = useSearchParams();
  const q = sp.get("q") || "";
  const sort = sp.get("sort") || "";
  const title = q
    ? `${t("search")}: ${q}`
    : sort === "latest"
      ? t("latest")
      : sort === "recommended"
        ? t("official")
        : sort === "popular"
          ? t("popular")
          : t("all");
  return <AssetStreamPage title={title} scope={{ kind: "all" }} />;
}
