<template>
    <navigator :url="`/pages/news_detail/news_detail?id=${newsId}`">
        <view class="news-card flex  px-[20rpx] py-[32rpx]">
            <view class="mr-[20rpx]" v-if="item.image">
                <u-image :src="item.image" width="240" height="180"></u-image>
            </view>
            <view class="news-card-content flex flex-col justify-between flex-1">
                <view class="news-card-content-title text-lg font-medium">{{ item.title }}</view>
            </view>
			<u-icon name="arrow-right" class="text-muted" size="28"></u-icon>
        </view>
    </navigator>
</template>

<script lang="ts" setup>
import { ref } from 'vue'

const props = withDefaults(
    defineProps<{
        item: any
        newsId: number
    }>(),
    {
        item: {},
        newsId: ''
    }
)
</script>

<style lang="scss" scoped>
.news-card {
    border-bottom: 1px solid #f8f8f8;
    &-content {
        &-title {
            -webkit-line-clamp: 1;
            overflow: hidden;
            word-break: break-all;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
        }
    }
}
</style>
