From 0e2ac6ec63944d8bebb123a862b18e337cbbbfbd Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 19 May 2023 16:39:28 +0700
Subject: Fix return null if no banner section

---
 src/lib/home/components/BannerSection.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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

diff --git a/src/lib/home/components/BannerSection.jsx b/src/lib/home/components/BannerSection.jsx
index 8459d08e..dfef071f 100644
--- a/src/lib/home/components/BannerSection.jsx
+++ b/src/lib/home/components/BannerSection.jsx
@@ -9,7 +9,8 @@ const BannerSection = () => {
   const bannerSection = useQuery('bannerSection', fetchBannerSection)
 
   return (
-    bannerSection.data && (
+    bannerSection.data &&
+    bannerSection.data?.length > 0 && (
       <div className='grid grid-cols-1 sm:grid-cols-2 gap-4'>
         {bannerSection.data?.map((banner) => (
           <Link key={banner.id} href={banner.url}>
-- 
cgit v1.2.3

