2025-03-01 07:57:12 +03:00
|
|
|
'use client';
|
|
|
|
|
|
2025-03-26 13:39:53 +03:00
|
|
|
import tagsPic from '../public/tags.svg';
|
|
|
|
|
import calendarPic from '../public/calendar.svg'
|
|
|
|
|
|
2025-03-01 08:20:55 +03:00
|
|
|
import AnimatedLink from '../components/animatedLink';
|
2025-03-01 07:57:12 +03:00
|
|
|
import Image from 'next/image';
|
|
|
|
|
|
2025-03-01 07:35:06 +03:00
|
|
|
interface BlogPost {
|
2025-03-01 07:58:21 +03:00
|
|
|
label: string;
|
|
|
|
|
body: string;
|
|
|
|
|
publish: string;
|
|
|
|
|
get_absolute_url: string;
|
2025-03-26 13:48:55 +03:00
|
|
|
tags: string[];
|
2025-03-01 07:35:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface BlogAreaProps {
|
2025-03-01 07:58:21 +03:00
|
|
|
blogposts: BlogPost[];
|
2025-03-01 07:35:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function BlogArea({ blogposts }: BlogAreaProps) {
|
2025-03-01 07:58:21 +03:00
|
|
|
return (
|
2025-03-26 13:39:53 +03:00
|
|
|
<div className="blog-area pt-16 pb-8 border-t border-white w-full">
|
2025-03-01 07:58:21 +03:00
|
|
|
<div className="blogposts">
|
|
|
|
|
{blogposts.map((blogpost, index) => (
|
2025-03-26 13:39:53 +03:00
|
|
|
<div key={index} className="blogpost flex flex-row overflow-hidden mb-14">
|
2025-03-01 07:58:21 +03:00
|
|
|
<div className="left mr-5">
|
|
|
|
|
<div className="blogpost-image">
|
|
|
|
|
<Image
|
|
|
|
|
src="/images/retrofuturism.webp" // Path to the local image
|
|
|
|
|
alt="Retrospective Science Image"
|
|
|
|
|
width={384} // Set width (in pixels)
|
|
|
|
|
height={384} // Set height (in pixels)
|
|
|
|
|
className="rounded-lg"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-03-26 00:33:17 +03:00
|
|
|
<div className="right flex flex-col w-full">
|
2025-03-01 07:58:21 +03:00
|
|
|
<div className="blogpost-label text-2xl mb-4">
|
|
|
|
|
<h2>
|
2025-03-01 08:20:55 +03:00
|
|
|
<AnimatedLink href={blogpost.get_absolute_url}>
|
2025-03-01 07:58:21 +03:00
|
|
|
{blogpost.label}
|
2025-03-01 08:20:55 +03:00
|
|
|
</AnimatedLink>
|
2025-03-01 07:58:21 +03:00
|
|
|
</h2>
|
|
|
|
|
</div>
|
2025-03-26 13:39:53 +03:00
|
|
|
<ul className="blogpost-tags inline-flex items-center flex-row space-x-4 mb-4">
|
|
|
|
|
<li className="tag inline px-2 py-1 rounded-full"><Image src={tagsPic} alt="lang" width={24} height={24} className='inline-flex justify-baseline filter brightness-0 invert' /></li>
|
2025-03-26 13:48:55 +03:00
|
|
|
{blogpost.tags.map((tag, index) => (
|
|
|
|
|
<li className="tag inline border border-slate-400 px-2 py-1 rounded-full text-base">{tag}</li>
|
|
|
|
|
))}
|
2025-03-01 07:58:21 +03:00
|
|
|
</ul>
|
|
|
|
|
<div className="blogpost-description text-base mb-4">
|
|
|
|
|
{blogpost.body.slice(0, 512)}...
|
|
|
|
|
</div>
|
2025-03-25 21:19:35 +03:00
|
|
|
<div className="blogpost-other flex flex-row justify-between items-end mt-auto">
|
2025-03-26 13:39:53 +03:00
|
|
|
<ul className="text-base inline-flex justify-end items-center">
|
|
|
|
|
<li className="inline px-2 py-1"><Image src={calendarPic} alt="lang" width={24} height={24} className="filter brightness-0 invert"/></li>
|
|
|
|
|
<li className="inline"><p className='inline mx-2'>{blogpost.publish}</p></li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div className="text-xl">
|
2025-03-01 08:20:55 +03:00
|
|
|
<AnimatedLink href={blogpost.get_absolute_url}>
|
2025-03-01 08:00:20 +03:00
|
|
|
Read the article
|
2025-03-01 08:20:55 +03:00
|
|
|
</AnimatedLink>
|
2025-03-01 07:58:21 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
2025-03-01 07:35:06 +03:00
|
|
|
</div>
|
2025-03-01 07:58:21 +03:00
|
|
|
{/* Include Pagination Component Here */}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2025-03-01 07:35:06 +03:00
|
|
|
}
|