import React from "react";

function NotificationBar(data) {
  const newsLists = [
    "Welcome To updatebharat",
    "for letest news and more updates",
  ];

  const newsList = data?.trandingList?.docs || [];

  console.log("NotificationBar", newsList);

  return (
    <div className="notification-bar">
      <div className="label">ताज़ा खबरें</div>
      <div className="news-scroll">
        {newsList?.length > 0 ? (
          <div className="scroll-content">
            {newsList.map((news, index) => (
              <span key={index} className="news-item">
                {news?.title}
              </span>
            ))}
          </div>
        ) : (
          <div className="scroll-content">
            {newsLists.map((news, index) => (
              <span key={index} className="news-item">
                {news}
              </span>
            ))}
          </div>
        )}
      </div>
    </div>
  );
}

export default NotificationBar;
