import { getNewsTickerItems } from '@/lib/db/dashboard';
import NewsItems from './NewsItems';

const NewsTicker = () => {
  const newsItems = getNewsTickerItems();

  const getColorClass = (color: string) => {
    const colors: Record<string, string> = {
      yellow: 'bg-yellow-400',
      green: 'bg-green-400',
      red: 'bg-red-400',
      blue: 'bg-blue-400',
      purple: 'bg-purple-400',
    };
    return colors[color] || 'bg-yellow-400';
  };

  return (
    <div className="max-w-7xl mx-auto px-3 sm:px-4 lg:px-8 -mt-4 sm:-mt-6 relative z-20">
      <div className="bg-linear-to-r from-blue-900 via-blue-800 to-blue-900 rounded-xl sm:rounded-2xl shadow-lg overflow-hidden border border-blue-700">
        <div className="flex items-center">
          <div className="bg-red-600 px-3 py-2 sm:px-4 sm:py-3 flex items-center gap-1.5 sm:gap-2 shrink-0 z-10">
            <span className="material-symbols-outlined text-white text-lg sm:text-xl animate-pulse">
              newspaper
            </span>
            <span className="text-white font-bold text-xs sm:text-sm md:text-base">
              সর্বশেষ খবর
            </span>
          </div>
          <NewsItems />
        </div>
      </div>
    </div>
  );
};

export default NewsTicker;
