Files
danak-website/src/app/blogs/components/BlogList.tsx
T
hamid zarghami 01470f14d6 link
2025-04-17 11:11:44 +03:30

48 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client'
import { FC } from 'react'
import HeroSection from './HeroSection'
import Category from './Category'
import BigBlogItem from './BigBlogItem'
import MostVisited from './MostVisited'
import ContactUs from './ContactUs'
import { useGetBlogs } from '../hooks/useBlogsData'
import { useBlogStore } from '../store/BlogStore'
const BlogList: FC = () => {
const { selectedCategory } = useBlogStore()
const { data } = useGetBlogs(selectedCategory)
return (
<div className=''>
<HeroSection />
<h1 className='text-2xl font-bold mt-10'>
مجله داناک
</h1>
<div className='mt-10 flex xl:flex-row flex-col gap-8'>
<div className='xl:w-[261px] w-full'>
<Category />
</div>
<div className='flex-1 flex flex-col gap-8'>
{data?.data.blogs.map((item) => (
<BigBlogItem key={item.id} item={item} />
))}
</div>
<div className='xl:w-[261px] w-full'>
<MostVisited />
<div className='mt-6'>
<ContactUs />
</div>
<div className='mt-6'>
<MostVisited />
</div>
</div>
</div>
</div>
)
}
export default BlogList