fix(mobile): enhance Recommendations component with empty state message

- Added a conditional rendering for the Recommendations component to display a message when no data is available.
- The new message informs users that the recommendations section is currently empty, improving user experience.

These changes provide clearer feedback to users when there are no recommendations to display.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-04-22 13:18:36 +08:00
parent 798f73dfe7
commit a0cfcd7ec4
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 9 additions and 0 deletions

View File

@ -137,6 +137,7 @@ export const RecommendationTab: TabComponent<{
if (!data) {
return []
}
return Object.keys(data).sort((a, b) => {
const aname = data[a]!.name
const bname = data[b]!.name
@ -226,6 +227,14 @@ export const RecommendationTab: TabComponent<{
return <PlatformActivityIndicator className="flex-1 items-center justify-center" />
}
if (keys.length === 0) {
return (
<View className="flex-1 items-center justify-center">
<Text className="text-secondary-label">This is a barren wasteland of knowledge.</Text>
</View>
)
}
return (
<View className="bg-system-background flex-1" {...rest}>
<FlashList