dynamic news
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
import React from 'react'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { news } from '@/app/staticData'
|
||||
import ShowMore from './ui/ShowMore'
|
||||
import { NewsProps } from '@/app/types'
|
||||
|
||||
interface NewsItem {
|
||||
id: number
|
||||
title: string
|
||||
description: string
|
||||
image: string
|
||||
slug: string
|
||||
}
|
||||
|
||||
export default function News() {
|
||||
const News: React.FC<NewsProps> = ({ news }) => {
|
||||
if (!news || news.length === 0) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<div className="w-full max-w-[1250px] mx-auto px-4 sm:px-6 mb-20">
|
||||
<h2 className="text-3xl sm:text-4xl text-center font-bold mb-10">
|
||||
@@ -33,7 +28,7 @@ export default function News() {
|
||||
</div>
|
||||
<div className="pt-6">
|
||||
<h3 className="text-base font-semibold mb-3">{item.title}</h3>
|
||||
<ShowMore text={item.description} />
|
||||
<ShowMore text={item.content} />
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
@@ -42,3 +37,5 @@ export default function News() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default News
|
||||
|
||||
Reference in New Issue
Block a user