summaryrefslogtreecommitdiff
path: root/src/lib/transaction/components/stepper.jsx
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-03-05 14:37:44 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2024-03-05 14:37:44 +0700
commit39b5e05a5fcc7ca26342f37e85c6585d1dacb3a5 (patch)
treecc3a02014e31ff6a15c149cf96345c91e753c78f /src/lib/transaction/components/stepper.jsx
parent07138ddc724233f688de9c16de59c1b61b885520 (diff)
add address & expedisi di page quotation - template stepper approval
Diffstat (limited to 'src/lib/transaction/components/stepper.jsx')
-rw-r--r--src/lib/transaction/components/stepper.jsx64
1 files changed, 64 insertions, 0 deletions
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;