From 9a15f2eea3f182ce8b9cf749f3dcd7b7f42efbaf Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 16 Nov 2024 10:08:14 +0700
Subject: <iman> CR website

---
 src/pages/my/menu.jsx | 97 +++++++++++++++++++++++++++++++++++----------------
 1 file changed, 66 insertions(+), 31 deletions(-)

(limited to 'src/pages/my/menu.jsx')

diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index a0ce223e..1b35d6ba 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -1,24 +1,24 @@
-import Divider from '@/core/components/elements/Divider/Divider'
-import Link from '@/core/components/elements/Link/Link'
-import AppLayout from '@/core/components/layouts/AppLayout'
-import useAuth from '@/core/hooks/useAuth'
-import { deleteAuth } from '@/core/utils/auth'
-import IsAuth from '@/lib/auth/components/IsAuth'
-import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'
-import { signOut, useSession } from 'next-auth/react'
-import { useRouter } from 'next/router'
-import ImageNext from 'next/image'
-
+import Divider from '@/core/components/elements/Divider/Divider';
+import Link from '@/core/components/elements/Link/Link';
+import AppLayout from '@/core/components/layouts/AppLayout';
+import useAuth from '@/core/hooks/useAuth';
+import { deleteAuth } from '@/core/utils/auth';
+import IsAuth from '@/lib/auth/components/IsAuth';
+import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid';
+import { signOut, useSession } from 'next-auth/react';
+import { useRouter } from 'next/router';
+import ImageNext from 'next/image';
+import whatsappUrl from '@/core/utils/whatsappUrl';
 export default function Menu() {
-  const auth = useAuth()
-  const router = useRouter()
-  const { data: session } = useSession()
+  const auth = useAuth();
+  const router = useRouter();
+  const { data: session } = useSession();
 
   const logout = () => {
     deleteAuth().then(() => {
-      router.push('/login')
-    })
-  }
+      router.push('/login');
+    });
+  };
 
   return (
     <IsAuth>
@@ -29,8 +29,12 @@ export default function Menu() {
           </div>
           <div className='ml-4'>
             <div className='font-semibold text-gray_r-12'>{auth?.name}</div>
-            {auth?.company && <div className='badge-solid-red mt-1'>Akun Bisnis</div>}
-            {!auth?.company && <div className='badge-gray mt-1'>Akun Individu</div>}
+            {auth?.company && (
+              <div className='badge-solid-red mt-1'>Akun Bisnis</div>
+            )}
+            {!auth?.company && (
+              <div className='badge-gray mt-1'>Akun Individu</div>
+            )}
           </div>
           <div className='ml-auto !text-gray_r-12'>
             <ChevronRightIcon className='w-6' />
@@ -47,32 +51,52 @@ export default function Menu() {
               <LinkItem href='/my/quotations'>
                 {' '}
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_daftar_quotation.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_daftar_quotation.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Daftar Quotation</p>
                 </div>
               </LinkItem>
               <LinkItem href='/my/transactions'>
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_daftar_transaksi.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_daftar_transaksi.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Daftar Transaksi</p>
                 </div>
               </LinkItem>
               <LinkItem href='/my/shipments'>
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_pengiriman.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_pengiriman.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Daftar Pengiriman</p>
                 </div>
               </LinkItem>
               <LinkItem href='/my/invoices'>
                 {' '}
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_invoice.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_invoice.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Invoice & Faktur Pajak</p>
                 </div>
               </LinkItem>
               <LinkItem href='/my/wishlist'>
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_wishlist.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_wishlist.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Wishlist</p>
                 </div>
               </LinkItem>
@@ -83,10 +107,14 @@ export default function Menu() {
             <MenuHeader>Pusat Bantuan</MenuHeader>
 
             <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
-              <LinkItem href='/'>
+              <LinkItem href={whatsappUrl('', '', '')}>
                 {' '}
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_layanan_pelanggan.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_layanan_pelanggan.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Layanan Pelanggan</p>
                 </div>
               </LinkItem>
@@ -99,7 +127,11 @@ export default function Menu() {
             <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
               <LinkItem href='/my/address'>
                 <div className='flex gap-x-3 items-center'>
-                  <ImageNext src='/images/icon/icon_daftar_alamat.svg' width={18} height={20} />
+                  <ImageNext
+                    src='/images/icon/icon_daftar_alamat.svg'
+                    width={18}
+                    height={20}
+                  />
                   <p>Daftar Alamat</p>
                 </div>
               </LinkItem>
@@ -112,20 +144,23 @@ export default function Menu() {
         </div>
       </AppLayout>
     </IsAuth>
-  )
+  );
 }
 
 const MenuHeader = ({ children, ...props }) => (
   <div {...props} className='font-medium px-4 flex'>
     {children}
   </div>
-)
+);
 
 const LinkItem = ({ children, ...props }) => (
-  <Link {...props} className='!text-gray_r-12/70 !font-normal p-4 flex items-center'>
+  <Link
+    {...props}
+    className='!text-gray_r-12/70 !font-normal p-4 flex items-center'
+  >
     {children}
     <div className='ml-auto !text-gray_r-11'>
       <ChevronRightIcon className='w-5' />
     </div>
   </Link>
-)
+);
-- 
cgit v1.2.3

