From 9622bff4d4902fcef81214236cc7ff035163e5e7 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 13 Nov 2024 16:46:14 +0700
Subject: <iman> pengajuan tempo

---
 src/pages/my/tempo/index.jsx | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 src/pages/my/tempo/index.jsx

(limited to 'src/pages/my/tempo/index.jsx')

diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
new file mode 100644
index 00000000..e540fbda
--- /dev/null
+++ b/src/pages/my/tempo/index.jsx
@@ -0,0 +1,27 @@
+import Seo from '@/core/components/Seo';
+import AppLayout from '@/core/components/layouts/AppLayout';
+import BasicLayout from '@/core/components/layouts/BasicLayout';
+import DesktopView from '@/core/components/views/DesktopView';
+import MobileView from '@/core/components/views/MobileView';
+import IsAuth from '@/lib/auth/components/IsAuth';
+import InvoicesComponent from '@/lib/invoice/components/Invoices';
+
+export default function MyTempo() {
+  return (
+    <IsAuth>
+      <Seo title='Tempo - Indoteknik.com' />
+
+      <MobileView>
+        <AppLayout title='Pembayaran Tempo'>
+          <InvoicesComponent />
+        </AppLayout>
+      </MobileView>
+
+      <DesktopView>
+        <BasicLayout>
+          <InvoicesComponent />
+        </BasicLayout>
+      </DesktopView>
+    </IsAuth>
+  );
+}
-- 
cgit v1.2.3


From f481bae4d28b770d85ca2340cff60acbec70d0ee Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 14 Nov 2024 09:45:15 +0700
Subject: <iman>

---
 src/pages/my/tempo/index.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/pages/my/tempo/index.jsx')

diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
index e540fbda..365986f4 100644
--- a/src/pages/my/tempo/index.jsx
+++ b/src/pages/my/tempo/index.jsx
@@ -4,7 +4,7 @@ import BasicLayout from '@/core/components/layouts/BasicLayout';
 import DesktopView from '@/core/components/views/DesktopView';
 import MobileView from '@/core/components/views/MobileView';
 import IsAuth from '@/lib/auth/components/IsAuth';
-import InvoicesComponent from '@/lib/invoice/components/Invoices';
+import InvoicesComponent from '@/lib/tempo/components/Tempo';
 
 export default function MyTempo() {
   return (
-- 
cgit v1.2.3


From 0178a1f88d7d34824562e1413be073c0795a47cf Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 16 Dec 2024 17:42:31 +0700
Subject: <iman> update code

---
 src/pages/my/tempo/index.jsx | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

(limited to 'src/pages/my/tempo/index.jsx')

diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
index 365986f4..f52fe960 100644
--- a/src/pages/my/tempo/index.jsx
+++ b/src/pages/my/tempo/index.jsx
@@ -5,8 +5,27 @@ import DesktopView from '@/core/components/views/DesktopView';
 import MobileView from '@/core/components/views/MobileView';
 import IsAuth from '@/lib/auth/components/IsAuth';
 import InvoicesComponent from '@/lib/tempo/components/Tempo';
-
+import { getAuth } from '~/libs/auth';
+import { useRouter } from 'next/router';
+import { useEffect, useState } from 'react';
 export default function MyTempo() {
+  const auth = getAuth();
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(true);
+  useEffect(() => {
+    if (!auth) {
+      const nextUrl = encodeURIComponent(router.asPath);
+      router.push(`/login?next=${nextUrl}`);
+    } else if (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') {
+      router.push('/pengajuan-tempo');
+    } else {
+      setIsLoading(false);
+    }
+  }, [auth]);
+
+  if (isLoading || !auth) {
+    return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia
+  }
   return (
     <IsAuth>
       <Seo title='Tempo - Indoteknik.com' />
-- 
cgit v1.2.3


From 21999682d2d6193d1033015c4e45f436a958f643 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 7 Jan 2025 15:56:56 +0700
Subject: <iman> update

---
 src/pages/my/tempo/index.jsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/pages/my/tempo/index.jsx')

diff --git a/src/pages/my/tempo/index.jsx b/src/pages/my/tempo/index.jsx
index f52fe960..a1897e51 100644
--- a/src/pages/my/tempo/index.jsx
+++ b/src/pages/my/tempo/index.jsx
@@ -16,7 +16,10 @@ export default function MyTempo() {
     if (!auth) {
       const nextUrl = encodeURIComponent(router.asPath);
       router.push(`/login?next=${nextUrl}`);
-    } else if (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') {
+    } else if (
+      (auth.tempoProgres === '' || auth.tempoProgres === 'rejected') &&
+      !auth.company
+    ) {
       router.push('/pengajuan-tempo');
     } else {
       setIsLoading(false);
-- 
cgit v1.2.3

