From 8492e0bccb64265d647efb34062787f56a2ddeb8 Mon Sep 17 00:00:00 2001
From: "Indoteknik ." <andrifebriyadiputra@gmail.com>
Date: Sat, 16 Aug 2025 10:51:54 +0700
Subject: (andri) filter swiper only > 8 desktop

---
 src/lib/home/components/MediaNews.jsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/lib/home/components/MediaNews.jsx')

diff --git a/src/lib/home/components/MediaNews.jsx b/src/lib/home/components/MediaNews.jsx
index 1c76398f..ec27a51d 100644
--- a/src/lib/home/components/MediaNews.jsx
+++ b/src/lib/home/components/MediaNews.jsx
@@ -40,12 +40,14 @@ const MediaNews = () => {
 
   const preferredMediaData = media.slice(0, 20);
 
+  const shouldUseSlider = isDesktop && preferredMediaData.length > 8;
+
   return (
     <div className="px-4 sm:px-0">
       <div className="flex justify-between items-center mb-4">
         <h1 className="font-semibold text-[14px] sm:text-h-lg">
           <Link href="/shop/media" className="!text-black font-semibold">
-            Media Berita
+            Media Partner
           </Link>
         </h1>
         <Link
@@ -58,7 +60,7 @@ const MediaNews = () => {
 
       {isLoading ? (
         <MediaNewsSkeleton />
-      ) : (
+      ) : shouldUseSlider ? (
         <Swiper {...swiperConfig}>
           {preferredMediaData.map((item) => (
             <SwiperSlide key={item.id}>
@@ -66,6 +68,12 @@ const MediaNews = () => {
             </SwiperSlide>
           ))}
         </Swiper>
+      ) : (
+        <div className="flex flex-wrap justify-center gap-4">
+          {preferredMediaData.map((item) => (
+            <MediaCard key={item.id} media={item} />
+          ))}
+        </div>
       )}
     </div>
   );
-- 
cgit v1.2.3

