From 00df44e6f25eaeabc56ebba8b4e9b1cb692928d7 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 20 Aug 2024 10:27:32 +0700
Subject: <iman> add new register

---
 .../register/components/RegistrasiBisnis.tsx       | 105 +++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 src-migrate/modules/register/components/RegistrasiBisnis.tsx

(limited to 'src-migrate/modules/register/components/RegistrasiBisnis.tsx')

diff --git a/src-migrate/modules/register/components/RegistrasiBisnis.tsx b/src-migrate/modules/register/components/RegistrasiBisnis.tsx
new file mode 100644
index 00000000..217b4c79
--- /dev/null
+++ b/src-migrate/modules/register/components/RegistrasiBisnis.tsx
@@ -0,0 +1,105 @@
+import { useState } from "react";
+import FormBisnis from "./FormBisnis";
+import Form from "./Form";
+import TermCondition from "./TermCondition";
+import FormCaptcha from "./FormCaptcha";
+import { Radio, RadioGroup, Stack, Divider } from '@chakra-ui/react'
+import React from "react";
+import {
+  ChevronDownIcon,
+  ChevronRightIcon
+} from '@heroicons/react/24/outline';
+
+const RegistrasiBisnis = () => {
+  const [isPKP, setIsPKP] = useState(false);
+  const [isTerdaftar, setIsTerdaftar] = useState(false);
+  const [isIndividuRequired, setIsIndividuRequired] = useState(true);
+  const [isBisnisRequired, setIsBisnisRequired] = useState(true);
+  const [selectedValue, setSelectedValue] = useState('PKP');
+
+  const handleChange = (value: string) => {
+    setSelectedValue(value);
+    if (value === "PKP") {
+      setIsPKP(true);
+      setIsIndividuRequired(true); // Show and require Individu form
+    } else {
+      setIsPKP(false);
+      setIsIndividuRequired(false); // Hide and make optional the Individu form
+    }
+  };
+
+  const handleClick = () => {
+    setIsIndividuRequired(!isIndividuRequired)
+  };
+
+  const handleClickBisnis = () => {
+    setIsBisnisRequired(!isBisnisRequired)
+  };
+
+  return (
+    <>
+      <div>
+        <p className="text-black font-bold">Tipe Bisnis</p>
+        <RadioGroup onChange={handleChange} value={selectedValue}>
+          <Stack direction='row'>
+            <Radio value='PKP'>PKP</Radio>
+            <Radio value='Non-PKP'>Non-PKP</Radio>
+          </Stack>
+        </RadioGroup>
+      </div>
+      <div className="mt-4 border">
+        <div className="p-4">
+          <div onClick={handleClick} className="flex justify-between">
+            <p>Data Akun</p>
+            {isIndividuRequired ? (
+              <div className="flex">
+                <ChevronDownIcon onClick={handleClick} className='h-6 w-6 text-black' />
+              </div>
+            ) : (
+              <ChevronRightIcon onClick={handleClick} className='h-6 w-6 text-black' />
+            )}
+          </div>
+          {isIndividuRequired && (
+            <div>
+              <Divider  my={4} />
+              <Form type="bisnis" required={isIndividuRequired} />
+            </div>
+          )}
+        </div>
+      </div>
+      <div className="mt-4 border">
+        <div className="p-4">
+          <div onClick={handleClickBisnis} className="flex justify-between">
+            <p>Data Bisnis</p>
+            {isBisnisRequired ? (
+              <div className="flex">
+                <ChevronDownIcon onClick={handleClickBisnis} className='h-6 w-6 text-black' />
+              </div>
+            ) : (
+              <ChevronRightIcon onClick={handleClickBisnis} className='h-6 w-6 text-black' />
+            )}
+          </div>
+          {isBisnisRequired && (
+            <div>
+              <Divider  my={4} />
+              <div>
+                <p className="text-black font-bold">Bisnis Terdaftar di Indoteknik?</p>
+                <RadioGroup onChange={handleChange} value={selectedValue}>
+                  <Stack direction='row'>
+                    <Radio value='true'>Sudah Terdaftar</Radio>
+                    <Radio value='false'>Belum Terdaftar</Radio>
+                  </Stack>
+                </RadioGroup>
+              </div>
+              <FormBisnis type="bisnis" required={isIndividuRequired} />
+            </div>
+          )}
+        </div>
+      </div>
+      <FormCaptcha />
+      <TermCondition />
+    </>
+  );
+};
+
+export default RegistrasiBisnis;
-- 
cgit v1.2.3

