From 39b5e05a5fcc7ca26342f37e85c6585d1dacb3a5 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 5 Mar 2024 14:37:44 +0700
Subject: add address & expedisi di page quotation - template stepper approval

---
 src/lib/transaction/components/stepper.jsx | 64 ++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 src/lib/transaction/components/stepper.jsx

(limited to 'src/lib/transaction/components/stepper.jsx')

diff --git a/src/lib/transaction/components/stepper.jsx b/src/lib/transaction/components/stepper.jsx
new file mode 100644
index 00000000..54243946
--- /dev/null
+++ b/src/lib/transaction/components/stepper.jsx
@@ -0,0 +1,64 @@
+import {
+  Box,
+  Step,
+  StepDescription,
+  StepIcon,
+  StepIndicator,
+  StepNumber,
+  StepSeparator,
+  StepStatus,
+  StepTitle,
+  Stepper,
+  useSteps,
+} from '@chakra-ui/react';
+import Image from 'next/image';
+
+const StepApproval = ({ layer, status }) => {
+  const steps = [
+    { title: 'Indoteknik', description: 'Contact Info', layer_approval: 1 },
+    { title: 'Manager', description: 'Date & Time', layer_approval: 2 },
+    { title: 'Director', description: 'Select Rooms', layer_approval: 3 },
+  ];
+  const { activeStep } = useSteps({
+    index: layer,
+    count: steps.length,
+  });
+  return (
+    <Stepper size='md' index={layer} colorScheme='green'>
+      {steps.map((step, index) => (
+        <Step key={index}>
+          <StepIndicator>
+            { layer === step.layer_approval && status === 'cancel' ? (
+              <StepStatus
+                complete={
+                  <Image
+                    src='/images/remove.png'
+                    width={20}
+                    height={20}
+                    alt=''
+                    className='w-full'
+                  />
+                }
+                incomplete={<StepNumber />}
+                active={<StepNumber />}
+              />
+            ) : (
+              <StepStatus
+                complete={<StepIcon />}
+                incomplete={<StepNumber />}
+                active={<StepNumber />}
+              />
+            )}
+          </StepIndicator>
+
+          <Box flexShrink='0'>
+            <StepTitle className='md:text-xs'>{step.title}</StepTitle>
+            <StepDescription className='md:text-[8px]'>{step.description}</StepDescription>
+          </Box>
+        </Step>
+      ))}
+    </Stepper>
+  );
+};
+
+export default StepApproval;
-- 
cgit v1.2.3


From 272bed12b28763b6f51b97012a4533ab17a561ae Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 6 Mar 2024 10:11:18 +0700
Subject: validation step approval

---
 src/lib/transaction/components/stepper.jsx | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

(limited to 'src/lib/transaction/components/stepper.jsx')

diff --git a/src/lib/transaction/components/stepper.jsx b/src/lib/transaction/components/stepper.jsx
index 54243946..bc3f6fd8 100644
--- a/src/lib/transaction/components/stepper.jsx
+++ b/src/lib/transaction/components/stepper.jsx
@@ -15,9 +15,9 @@ import Image from 'next/image';
 
 const StepApproval = ({ layer, status }) => {
   const steps = [
-    { title: 'Indoteknik', description: 'Contact Info', layer_approval: 1 },
-    { title: 'Manager', description: 'Date & Time', layer_approval: 2 },
-    { title: 'Director', description: 'Select Rooms', layer_approval: 3 },
+    { title: 'Indoteknik', layer_approval: 1 },
+    { title: 'Manager', layer_approval: 2 },
+    { title: 'Director', layer_approval: 3 },
   ];
   const { activeStep } = useSteps({
     index: layer,
@@ -28,7 +28,7 @@ const StepApproval = ({ layer, status }) => {
       {steps.map((step, index) => (
         <Step key={index}>
           <StepIndicator>
-            { layer === step.layer_approval && status === 'cancel' ? (
+            {layer === step.layer_approval && status === 'cancel' ? (
               <StepStatus
                 complete={
                   <Image
@@ -53,8 +53,17 @@ const StepApproval = ({ layer, status }) => {
 
           <Box flexShrink='0'>
             <StepTitle className='md:text-xs'>{step.title}</StepTitle>
-            <StepDescription className='md:text-[8px]'>{step.description}</StepDescription>
+            {layer > step.layer_approval && (
+              <StepDescription className='md:text-[8px]'>Approved</StepDescription>
+            )}
+            {layer === step.layer_approval && status === 'cancel' && (
+              <StepDescription className='md:text-[8px]'>Rejected</StepDescription>
+            )}
+            {layer < step.layer_approval && (
+              <StepDescription className='md:text-[8px]'>Pending</StepDescription>
+            )}
           </Box>
+          <StepSeparator _horizontal={{ ml: '0' }} />
         </Step>
       ))}
     </Stepper>
-- 
cgit v1.2.3


From a5db88b5e8574edb1908fd2a9b9fa6cf5ed2ff05 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 6 Mar 2024 14:30:27 +0700
Subject: add approve dan reject

---
 src/lib/transaction/components/stepper.jsx | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

(limited to 'src/lib/transaction/components/stepper.jsx')

diff --git a/src/lib/transaction/components/stepper.jsx b/src/lib/transaction/components/stepper.jsx
index bc3f6fd8..a121cabd 100644
--- a/src/lib/transaction/components/stepper.jsx
+++ b/src/lib/transaction/components/stepper.jsx
@@ -53,14 +53,24 @@ const StepApproval = ({ layer, status }) => {
 
           <Box flexShrink='0'>
             <StepTitle className='md:text-xs'>{step.title}</StepTitle>
-            {layer > step.layer_approval && (
-              <StepDescription className='md:text-[8px]'>Approved</StepDescription>
-            )}
-            {layer === step.layer_approval && status === 'cancel' && (
-              <StepDescription className='md:text-[8px]'>Rejected</StepDescription>
-            )}
-            {layer < step.layer_approval && (
-              <StepDescription className='md:text-[8px]'>Pending</StepDescription>
+            {status === 'cancel' ? (
+              layer > step.layer_approval ? (
+                <StepDescription className='md:text-[8px]'>
+                  Approved
+                </StepDescription>
+              ) : (
+                <StepDescription className='md:text-[8px]'>
+                  Rejected
+                </StepDescription>
+              )
+            ) : layer > step.layer_approval ? (
+              <StepDescription className='md:text-[8px]'>
+                Approved
+              </StepDescription>
+            ) : (
+              <StepDescription className='md:text-[8px]'>
+                Pending
+              </StepDescription>
             )}
           </Box>
           <StepSeparator _horizontal={{ ml: '0' }} />
-- 
cgit v1.2.3


From 29d9a52cea9068da988f48d14fa1e0d8588bd65f Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 6 Mar 2024 14:48:17 +0700
Subject: approved

---
 src/lib/transaction/components/stepper.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/transaction/components/stepper.jsx')

diff --git a/src/lib/transaction/components/stepper.jsx b/src/lib/transaction/components/stepper.jsx
index a121cabd..9b0da0d9 100644
--- a/src/lib/transaction/components/stepper.jsx
+++ b/src/lib/transaction/components/stepper.jsx
@@ -63,7 +63,7 @@ const StepApproval = ({ layer, status }) => {
                   Rejected
                 </StepDescription>
               )
-            ) : layer > step.layer_approval ? (
+            ) : layer >= step.layer_approval ? (
               <StepDescription className='md:text-[8px]'>
                 Approved
               </StepDescription>
-- 
cgit v1.2.3

