package com.aiosman.ravenow.ui.index.tabs.moment.tabs.recommend

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.aiosman.ravenow.entity.MomentEntity
import com.aiosman.ravenow.ui.index.tabs.moment.tabs.news.NewsItem

/**
 * 新闻推荐Item组件
 * 复用 NewsItem 组件
 * 注意：如果新闻没有图片，则不显示（返回空）
 */
@Composable
fun NewsRecommendationItem(
    moment: MomentEntity,
    onCommentClick: () -> Unit = {},
    onReadFullClick: () -> Unit = {},
    onLikeClick: () -> Unit = {},
    onFavoriteClick: () -> Unit = {},
    modifier: Modifier = Modifier
) {
    // 如果新闻没有图片，则不显示
    if (moment.images.isEmpty()) {
        return
    }
    
    NewsItem(
        moment = moment,
        modifier = modifier.fillMaxSize(),
        onCommentClick = onCommentClick,
        onReadFullClick = onReadFullClick,
        onLikeClick = onLikeClick,
        onFavoriteClick = onFavoriteClick
    )
}

