You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
29 lines
1.1 KiB
/* eslint-disable-next-line */
|
|
import {getStrapiImageSize} from "../../libs/utils";
|
|
import CardBlog from "../card-blog/card-blog";
|
|
import HomeSectionBlogUne from "../home-section-blog-une/home-section-blog-une";
|
|
|
|
export interface HomeSectionBlogProps {
|
|
posts: object[];
|
|
}
|
|
|
|
export function HomeSectionBlog({posts = []}: HomeSectionBlogProps) {
|
|
const firstArticle = posts.length > 0 ? posts.slice(0, 1) : [];
|
|
const otherArticles = posts.length > 0 ? posts.slice(1, posts.length) : [];
|
|
return (
|
|
<>
|
|
<section className="container max-w-6xl relative mx-auto relative flex flex-col md:flex-row mb-10 h-auto">
|
|
<div className="w-12/12 md:w-6/12 px-4 mb-4 md:mb-0 md:px-0 md:pr-2">
|
|
<HomeSectionBlogUne item={firstArticle[0]} />
|
|
</div>
|
|
<div className="w-12/12 md:w-6/12 px-4 md:px-0 md:pl-2">
|
|
{otherArticles.map((item: object, index: number) => (<CardBlog key={"home-card-blog-" + index}
|
|
item={item} />))}
|
|
</div>
|
|
</section>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default HomeSectionBlog;
|