2024-11-05 13:57:39 +01:00
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import { BlogCardDetails } from 'types'
|
|
|
|
import { getBlogPageRoute } from 'routes'
|
2024-07-11 18:34:12 +05:00
|
|
|
import '../styles/cardBlogs.css'
|
2024-11-05 13:57:39 +01:00
|
|
|
import placeholder from '../assets/img/DEGMods Placeholder Img.png'
|
2024-07-11 18:34:12 +05:00
|
|
|
|
2024-11-05 13:57:39 +01:00
|
|
|
type BlogCardProps = Partial<BlogCardDetails>
|
|
|
|
|
|
|
|
export const BlogCard = ({ title, image, nsfw, naddr }: BlogCardProps) => {
|
|
|
|
if (!naddr) return null
|
2024-07-11 18:34:12 +05:00
|
|
|
|
|
|
|
return (
|
2024-11-05 13:57:39 +01:00
|
|
|
<Link to={getBlogPageRoute(naddr)} className='cardBlogMainWrapperLink'>
|
2024-07-11 18:34:12 +05:00
|
|
|
<div
|
|
|
|
className='cardBlogMain'
|
|
|
|
style={{
|
2024-11-05 13:57:39 +01:00
|
|
|
background: `url("${
|
|
|
|
image ? image : placeholder
|
|
|
|
}") center / cover no-repeat`
|
2024-07-11 18:34:12 +05:00
|
|
|
}}
|
|
|
|
>
|
2024-11-05 13:57:39 +01:00
|
|
|
<div className='cardBlogMainInside'>
|
|
|
|
<h3 className='cardBlogMainInsideTitle'>{title}</h3>
|
|
|
|
{nsfw && (
|
|
|
|
<div className='IBMSMSMBSSTagsTag IBMSMSMBSSTagsTagNSFW IBMSMSMBSSTagsTagNSFWCard IBMSMSMBSSTagsTagNSFWCardAlt'>
|
|
|
|
<p>NSFW</p>
|
|
|
|
</div>
|
|
|
|
)}
|
2024-07-11 18:34:12 +05:00
|
|
|
</div>
|
2024-11-05 13:57:39 +01:00
|
|
|
</div>
|
|
|
|
</Link>
|
2024-07-11 18:34:12 +05:00
|
|
|
)
|
|
|
|
}
|