dynamic news
This commit is contained in:
@@ -7,10 +7,12 @@ import { data } from '@/app/staticData'
|
||||
import { routes } from '@/app/staticData'
|
||||
import Button from '@/components/ui/Button'
|
||||
import News from '@/components/News'
|
||||
import { getFAQs } from '@/lib/fetchFAQ'
|
||||
import { getFAQs } from '@/lib/main/fetchFAQ'
|
||||
import { getNews } from '@/lib/main/fetchNews'
|
||||
|
||||
export default async function Home() {
|
||||
const faqs = await getFAQs()
|
||||
const news = await getNews()
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center max-w-[93%] mx-auto">
|
||||
@@ -239,7 +241,7 @@ export default async function Home() {
|
||||
<FAQ faqs={faqs} />
|
||||
|
||||
{/* новости */}
|
||||
<News />
|
||||
<News news={news} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -54,3 +54,15 @@ export interface FAQ {
|
||||
export interface FAQProps {
|
||||
faqs: FAQ[]
|
||||
}
|
||||
|
||||
export interface NewsItem {
|
||||
id: number
|
||||
title: string
|
||||
content: string
|
||||
image: string
|
||||
slug: string
|
||||
}
|
||||
|
||||
export interface NewsProps {
|
||||
news: NewsItem[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user