2025-03-10 17:38:16 +08:00
|
|
|
"use client";
|
|
|
|
|
2024-07-15 16:54:04 +08:00
|
|
|
import React from "react";
|
|
|
|
import { DotLoading } from "antd-mobile";
|
|
|
|
import Empty from "@/components/Empty";
|
2025-03-10 17:38:16 +08:00
|
|
|
import { useRouter } from "next/navigation";
|
2024-07-30 22:53:41 +08:00
|
|
|
export default function InfiniteScrollContent({
|
2025-03-10 17:38:16 +08:00
|
|
|
hasMore = 0,
|
2024-07-30 22:53:41 +08:00
|
|
|
isEmpty,
|
|
|
|
showNoMore = true,
|
2025-03-12 18:25:31 +08:00
|
|
|
zoneEmpty = false,
|
|
|
|
type = "nodata",
|
2024-07-30 22:53:41 +08:00
|
|
|
}) {
|
2025-03-10 17:38:16 +08:00
|
|
|
const router = useRouter();
|
2024-07-15 16:54:04 +08:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{hasMore ? (
|
|
|
|
<>
|
|
|
|
<span>加载中</span>
|
|
|
|
<DotLoading />
|
|
|
|
</>
|
2024-07-30 22:53:41 +08:00
|
|
|
) : !showNoMore ? null : !isEmpty ? (
|
2024-07-15 16:54:04 +08:00
|
|
|
<span>没有更多了</span>
|
|
|
|
) : (
|
|
|
|
<div
|
|
|
|
className={`flex flex-col items-center mt-28`}
|
|
|
|
// style={{ height: `${scrollHeight}px` }}
|
|
|
|
>
|
2025-03-12 18:25:31 +08:00
|
|
|
<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>
|
|
|
|
)}
|
2024-07-15 16:54:04 +08:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|