Untitled

 avatar
user_5257650
plain_text
7 months ago
2.6 kB
0
Indexable
Never
import styles from "@/styles/news/NewsList.module.css";
import he from "he";
import { Interweave } from "interweave";
import Image from "next/image";
import { useRouter } from "next/router";
import { HiArrowLeft } from "react-icons/hi";
import AdsterraBanner320 from "../adsterra/AdsterraBanner320";
import AdsterraBanner600 from "../adsterra/AdsterraBanner600";

export default function NewsDetails({ newsDetailsPost }) {
	const router = useRouter();
	return (
		<>
			<div className={`${styles.adscontent}`}>
				<div className={`${styles.adswrapper} ${styles.adswrapper1}`}>
					<AdsterraBanner600 />
				</div>
				<div className={`${styles.news_details__container}`}>
					<div className="fixt_top_content">
						<HiArrowLeft
							className="backArrowBtn"
							onClick={() => router.back()}
						/>
						{newsDetailsPost.link}
						<div className={styles.marquee_content}>
							<marquee>{he.decode(newsDetailsPost.title)}</marquee>
						</div>
					</div>

					<div className="news__poster">
						{newsDetailsPost.news_type == "in_app" ? (
							<Image
								className={styles.single_video__banner_details}
								loader={() =>
									`${process.env.NEXT_PUBLIC_XOOMSPORT_URL}/${newsDetailsPost.image}`
								}
								// src={newsDetailsPost.image}
								src={`${process.env.NEXT_PUBLIC_XOOMSPORT_URL}/${newsDetailsPost.image}`}
								width="300"
								height="200"
								alt="sport-banner"
								unoptimized={true}
							/>
						) : (
							<Image
								className={styles.single_video__banner_details}
								loader={() => newsDetailsPost.image}
								src={newsDetailsPost.image}
								width="300"
								height="200"
								alt="sport-banner"
								unoptimized={true}
							/>
						)}
					</div>
					<div className={styles.news_details__wrapper}>
						<span className={styles.news__title_details}>
							{he.decode(newsDetailsPost.title)}
						</span>

						{newsDetailsPost.news_type == "in_app" ? (
							<Interweave
								content={newsDetailsPost.description}
								containerTagName="div"
							/>
						) : (
							newsDetailsPost.desc.map((item, index) => (
								<span className="news__desc" key={item}>
									{item.details}
									<br />
									<br />
									{index === 2 && (
										<>
											<AdsterraBanner320 />
										</>
									)}
								</span>
							))
						)}
					</div>
				</div>
				<div className={styles.adswrapper}>
					<AdsterraBanner600 />
				</div>
			</div>
		</>
	);
}
Leave a Comment