import React from "react";
import "./Blog_card.css";
import parse from "html-react-parser";
import Link from "next/link";

function Blog_card({ baseLink, blogData }) {
  return (
    <>
      <Link href={baseLink} style={{textDecoration:"none"}}>
        <section className="Blog_card">
          <div className="main_content_holder">
            <div className="img_holder">
              <img
                className="Blog_img"
                src={process.env.NEXT_PUBLIC_IMG_URL + blogData.image}
                alt={"Blog_img"}
              />
            </div>
            <div className="text_holder">
              <p className="title_text heading_text">{blogData.name}</p>
              <p className="descn para_text">{blogData.subname}</p>
              <p className="para_text">
                {parse(
                  typeof blogData?.description === "string"
                    ? blogData.description
                    : "",
                )}
              </p>
            </div>
          </div>
        </section>
      </Link>
    </>
  );
}

export default Blog_card;
