
import categoryIcon from "./../../assets/images/CategoryTagIcon.svg"
import viewIcon from "./../../assets/images/EyeIcon.svg"
import {EnglishToPersian} from "../../helpers/EnglishToPersian";
import {Link} from "react-router-dom";
export default function ArticleCard({article, asd, className}) {
    return (
        <Link to={`edit/${article.id}`} className={'rounded-xl border-1 flex flex-col justify-between bg-1 ' + className}>
            <img className={'rounded-top-3 product-card-image'} src={article.image_thumbnail} alt={article.title}/>
            <div className={'mx-3 flex flex-col pt-3 w-[20vw]'}>                <span className={'truncate font-[Vazirmatn] font-medium text-lg'}>{article.title}</span>
                <div className={'flex flex-col md:flex-row items-center justify-between my-5'}>
                    <div className={'px-3 bg-[#E6E6E6] rounded-xl flex item-center flex-row justify-between'}>
                        <img src={viewIcon} alt={''}/>
                        <span className={'mr-1 text-[#333333] font-[Vazirmatn]'}>{EnglishToPersian(article.viewCount ? article.viewCount.toString() : '0')}</span>
                    </div>
                </div>
            </div>
        </Link>
    )
}