import { Blog } from '@/app/blogs/types/BlogTypes'
import Image from 'next/image'
import { FC } from 'react'

interface Props {
    item: Blog
}

const BlogItem: FC<Props> = ({ item }) => {
    return (
        <div className='flex-1 w-full min-h-[390px] rounded-4xl overflow-hidden relative'>
            <Image
                src={item.imageUrl}
                layout='fill'
                objectFit='cover'
                alt='blog'
            />

            <div className='absolute top-6 left-6 bg-black text-white h-8 px-5 rounded-xl flex items-center text-sm'>
                {item.category?.title}
            </div>

            <div className='absolute bottom-0 left-0 w-full modalGlass3 h-[180px]  rounded-b-3xl text-white p-6'>
                <h6 className='font-bold text-sm'>
                    {item.title}
                </h6>

                <p className='mt-4 text-sm' dangerouslySetInnerHTML={{ __html: item.previewContent }}>
                </p>
            </div>
        </div>
    )
}

export default BlogItem