import React, { Component } from "react"; import { Link } from "react-router-dom"; import music from "~/assets/images/music.jpg"; import video from "~/assets/images/film.jpg"; import moment from "jalali-moment"; import "./index.scss"; const maxDesktopSize = 1250; const fontSize = { desktop: { h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 80, h2: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95, span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 110, a: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 90, }, }; const colors = [ { name: window.t("علمی تخیلی"), color: "red" }, { name: window.t("سیاسی"), color: "blue" }, { name: window.t("تاریخی"), color: "orange" }, { name: window.t("ورزشی"), color: "yellow" }, ]; export default class Simple extends Component { render() { const { height, data } = this.props; return ( <> {window.innerWidth > 1000 ? (
{data.type === "image" ? ( {data.title} ) : null} {data.type === "video" ? ( {data.title} ) : null} {data.type === "audio" ? ( {data.title} ) : null}

{data.title}

{/* */}
{window.t("مطالعه کامل در {data.duration} دقیقه")}{" "} {window.t("تاریخ انتشار")}{" "} {moment(data.createdAt).format("YYYY/MM/DD")}
{window.t("ادامه مطلب")}{" "}
item.name === data.tag)[0]?.color || "#33333366", fontSize: fontSize.desktop.span, }} > {data.tag}
) : null} {window.innerWidth < 1000 ? (
{data.type === "image" ? (
{data.title}
) : null} {data.type === "video" ? ( {data.title} ) : null} {data.type === "audio" ? ( {data.title} ) : null}

{data.title}

{/* */}
{window.t("مطالعه کامل در")} {data.duration}{" "} {window.t("دقیقه")} {window.t("تاریخ انتشار")}{" "} {moment(data.createdAt).format("YYYY/MM/DD")}
{data.buttonText || window.t("ادامه مطلب")}
{data.tag}
) : null} ); } }