"use client"; import React from "react"; import { useSettingsStore } from "../lib/store/settingsStore"; import { Sparkles } from "lucide-react"; import Link from "next/link"; import Image from "next/image"; export default function TickerBanner() { const getText = useSettingsStore((state) => state.getText); const logoUrl = getText("site_logo", ""); const textEn = getText("site_logo_text_en", "Canina"); const textFa = getText("site_logo_text_fa", "ایران"); const isBlobOrData = typeof logoUrl === 'string' && (logoUrl.startsWith('blob:') || logoUrl.startsWith('data:')); const announcementText = getText( "shipping_notice", "ارسال رایگان برای سفارش‌های بالای ۱۵۰ هزار تومان — گارانتی اصالت کنینا آلمان — مشاوره تخصصی مکمل‌های دارویی سگ و گربه با کادر دامپزشکان مجرب" ); return (
{/* Mobile: Logo on the right + Ticker marquee on the left in one single row */}
{/* Mobile Compact Logo */} {logoUrl ? ( {`${textEn} ) : (
{textEn.charAt(0).toUpperCase() || "C"} {textEn} {textFa && ( {textFa} )}
)} {/* Marquee ticker filling the rest */}
{announcementText} {announcementText} {announcementText}
{/* Desktop: Full-width ticker banner as before */}
{announcementText} {announcementText} {announcementText} {announcementText}
); }