fix: conditionally render feed preview and items based on entries availability

- Updated the rendering logic in the share list component to display the feed preview and items only when there are entries available. This change enhances the user experience by preventing empty states and ensuring that the UI reflects the current data accurately.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-01-15 16:59:08 +08:00
parent a92364f025
commit 15a14c63b6
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 8 additions and 4 deletions

View File

@ -113,10 +113,14 @@ export function Component() {
</div>
)}
</div>
<div className="mt-8 text-zinc-500">{t("feed.preview")}</div>
<div className={cn("w-full pb-12 pt-8", "flex max-w-3xl flex-col gap-2")}>
<Item entries={list.data.entries} view={list.data.list.view} />
</div>
{!!list.data.entries?.length && (
<>
<div className="mt-8 text-zinc-500">{t("feed.preview")}</div>
<div className={cn("w-full pb-12 pt-8", "flex max-w-3xl flex-col gap-2")}>
<Item entries={list.data.entries} view={list.data.list.view} />
</div>
</>
)}
</div>
)
)}