tiefen_space_h5/components/InfiniteScrollContent/index.jsx

51 lines
1.4 KiB
React
Raw Normal View History

"use client";
import React from "react";
import { DotLoading } from "antd-mobile";
import Empty from "@/components/Empty";
import { useRouter } from "next/navigation";
2024-07-30 22:53:41 +08:00
export default function InfiniteScrollContent({
hasMore = 0,
2024-07-30 22:53:41 +08:00
isEmpty,
showNoMore = true,
zoneEmpty = false,
type = "nodata",
2024-07-30 22:53:41 +08:00
}) {
const router = useRouter();
return (
<>
{hasMore ? (
<>
<span>加载中</span>
<DotLoading />
</>
2024-07-30 22:53:41 +08:00
) : !showNoMore ? null : !isEmpty ? (
<span>没有更多了</span>
) : (
<div
className={`flex flex-col items-center mt-28`}
// style={{ height: `${scrollHeight}px` }}
>
<Empty type={type} />
{zoneEmpty && (
<div className="text-white">
<p
onClick={() => router.push("/search")}
className="text-base font-medium flex items-center justify-center bg-[#FFFFFF1A] mt-2 rounded-full w-[190px] h-[46px]"
>
搜索空间
</p>
<p
onClick={() => router.push("/found")}
className="text-base font-medium flex items-center justify-center bg-[#FFFFFF1A] mt-2 rounded-full w-[190px] h-[46px]"
>
查看推荐
</p>
</div>
)}
</div>
)}
</>
);
}