From f66b12fd1d0b83af0d7230d7b1565fbe00afbe3c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 22 Feb 2023 11:03:34 +0700
Subject: prettier

---
 src/lib/address/components/Addresses.jsx | 80 ++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 35 deletions(-)

(limited to 'src/lib/address/components/Addresses.jsx')

diff --git a/src/lib/address/components/Addresses.jsx b/src/lib/address/components/Addresses.jsx
index 7a82c0da..c4855f8f 100644
--- a/src/lib/address/components/Addresses.jsx
+++ b/src/lib/address/components/Addresses.jsx
@@ -1,15 +1,13 @@
-import Link from "@/core/components/elements/Link/Link"
-import Spinner from "@/core/components/elements/Spinner/Spinner"
-import useAuth from "@/core/hooks/useAuth"
-import { getItemAddress, updateItemAddress } from "@/core/utils/address"
-import { useRouter } from "next/router"
-import useAddresses from "../hooks/useAddresses"
+import Link from '@/core/components/elements/Link/Link'
+import Spinner from '@/core/components/elements/Spinner/Spinner'
+import useAuth from '@/core/hooks/useAuth'
+import { getItemAddress, updateItemAddress } from '@/core/utils/address'
+import { useRouter } from 'next/router'
+import useAddresses from '../hooks/useAddresses'
 
 const Addresses = () => {
   const router = useRouter()
-  const {
-    select = null
-  } = router.query
+  const { select = null } = router.query
   const auth = useAuth()
   const { addresses } = useAddresses()
   const selectedAdress = getItemAddress(select || '')
@@ -21,48 +19,60 @@ const Addresses = () => {
 
   if (addresses.isLoading) {
     return (
-      <div className="flex justify-center my-6">
-        <Spinner className="w-6 text-gray_r-12/50 fill-gray_r-12" />
+      <div className='flex justify-center my-6'>
+        <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' />
       </div>
     )
   }
 
   return (
-    <div className="p-4">
-      <div className="text-right">
-        <Link href="/my/address/create">Tambah Alamat</Link>
+    <div className='p-4'>
+      <div className='text-right'>
+        <Link href='/my/address/create'>Tambah Alamat</Link>
       </div>
 
-      <div className="grid gap-y-4 mt-4">
-        { addresses.data?.map((address, index) => {
-          let type = address.type.charAt(0).toUpperCase() + address.type.slice(1) + ' Address';
+      <div className='grid gap-y-4 mt-4'>
+        {addresses.data?.map((address, index) => {
+          let type = address.type.charAt(0).toUpperCase() + address.type.slice(1) + ' Address'
           return (
-            <div 
-              key={index} 
-              className={"p-4 rounded-md border " + (selectedAdress && selectedAdress == address.id ? "border-gray_r-7 bg-gray_r-2" : "border-gray_r-7") } 
+            <div
+              key={index}
+              className={
+                'p-4 rounded-md border ' +
+                (selectedAdress && selectedAdress == address.id
+                  ? 'border-gray_r-7 bg-gray_r-2'
+                  : 'border-gray_r-7')
+              }
             >
               <div onClick={() => changeSelectedAddress(address.id)}>
-                <div className="flex gap-x-2" >
-                  <div className="badge-red">{ type }</div>
-                  { auth?.partnerId == address.id && (
-                    <div className="badge-green">Utama</div>
-                  ) }
+                <div className='flex gap-x-2'>
+                  <div className='badge-red'>{type}</div>
+                  {auth?.partnerId == address.id && <div className='badge-green'>Utama</div>}
                 </div>
-                <p className="font-medium mt-2">{ address.name }</p>
-                { address.mobile && (
-                  <p className="mt-2 text-gray_r-11">{ address.mobile }</p>
-                ) }
-                <p className={`mt-1 leading-6 ${selectedAdress && selectedAdress == address.id ? "text-gray_r-12" : "text-gray_r-11"}`}>
-                  { address.street }
+                <p className='font-medium mt-2'>{address.name}</p>
+                {address.mobile && <p className='mt-2 text-gray_r-11'>{address.mobile}</p>}
+                <p
+                  className={`mt-1 leading-6 ${
+                    selectedAdress && selectedAdress == address.id
+                      ? 'text-gray_r-12'
+                      : 'text-gray_r-11'
+                  }`}
+                >
+                  {address.street}
                 </p>
               </div>
-              <Link href={`/my/address/${address.id}/edit`} className="btn-light bg-white mt-3 w-full !text-gray_r-11">Ubah Alamat</Link>
+              <Link
+                href={`/my/address/${address.id}/edit`}
+                className='btn-light bg-white mt-3 w-full !text-gray_r-11'
+              >
+                Ubah Alamat
+              </Link>
             </div>
-          );
-        }) }
+          )
+        })}
       </div>
     </div>
   )
 }
 
-export default Addresses
\ No newline at end of file
+export default Addresses
-- 
cgit v1.2.3

