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:
parent
798f73dfe7
commit
a0cfcd7ec4
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue