dynamic news

This commit is contained in:
2025-05-16 11:41:36 +03:00
parent 21498f8f25
commit 8d7be8f829
12 changed files with 130 additions and 31 deletions

View File

@@ -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>
)
}

View File

@@ -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[]
}