import { useEffect, useState } from "react";
import {
  Button,
  Card,
  Col,
  Form,
  Row,
  Stack,
  Tab,
  Table,
  Tabs,
} from "react-bootstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import * as Icons from "@fortawesome/free-solid-svg-icons";
import styled from "@emotion/styled";
import axios from "axios";
import { toast } from "react-toastify";
import { useFormik } from "formik";
import * as Yup from "yup";
import { log } from "console";

const ITDWrapper = styled.div`
  /* .overlay {
    position: absolute;
    transition: 0.3s ease;
    input {
      width: 30px;
      height: 30px;
      opacity: 0;
    }
  }
  .icon {
    font-size: 35px;
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    text-align: center;
  } */
  .uploadSlip {
    vertical-align: middle;
  }
`;
const OldRegime = () => {
  const [currentTab, setCurrentTab] = useState(0);

  const [getlocdata, setLocalData] = useState<any>([]);

  
  const formik:any = useFormik({
    initialValues: {
      emp_pan:"",
      house_rent:"",
      handicap_depend_80dd:"",
      raj_gandhi_scheme_80ccg: "",
      int_on_saving_80tta: "",
      pf_jeevan_suraksha: "",
      lic: "",
      int_loan_const_acco: "",
      int_house_loaan: "",
      notif_pens_sch: "",
      emp_contri: "",
      annuity_pension_plan: "",
      five_yrs_bank_deposit: "",
      deposit_home_looan_sch: "",
      child_tution_fee: "",
      invest_elss: "",
      pf_uti_mutual_fund: "",
      housing_loan_repay: "",
      ulip_uti_lic: "",
      public_pf: "",
      deferred_annuity: "",
      handicap_80u:"",
      paid_rent_80gg:"",
      high_edu_loan_80e:"",
      medic_insur_prem_80d:"",
      residence:"",
      others:"",
      other:"",
      other_deduct:"",
      rent_file:"",
      chapter_vi_a_file:"",
      deduct_80c_file:"",
      deduct_80cc_file:"",
      deduct_80ccc_file:"",
      deduct_80ccd_file:"",
      deduct_us24_file:"",


    },
    validationSchema: Yup.object({
      paid_rent_80gg:Yup.number().max(60000,"max limit is 60000"),
      raj_gandhi_scheme_80ccg: Yup.number().max(25000,"maximum limit is 25000"),
      int_on_saving_80tta: Yup.number().max(50000,'maximum 50000'),
      pf_jeevan_suraksha: Yup.number().max(150000,"Minimum 1,50,000.00"),
      lic: Yup.number().max(150000,"maximum 150000"),
      int_loan_const_acco: Yup.number().max(30000,"maximum 30000"),
      int_house_loaan: Yup.number().max(200000,"maximum 20,0000"),
      notif_pens_sch: Yup.number().max(150000,"maximum 150000"),
      emp_contri: Yup.number().max(50000,"maximum 50000"),
      annuity_pension_plan: Yup.number().max(150000,"maximum 150000"),
      five_yrs_bank_deposit: Yup.number().max(150000,"maximum 150000"),
      deposit_home_looan_sch: Yup.number().max(150000,"maximum 150000"),
      child_tution_fee: Yup.number().max(150000,"maximum 150000"),
      invest_elss: Yup.number().max(150000,"maximum 150000"),
      pf_uti_mutual_fund: Yup.number().max(150000,"maximum 150000"),
      housing_loan_repay: Yup.number().max(150000,"maximum 150000"),
      ulip_uti_lic: Yup.number().max(150000,"maximum 150000"),
      public_pf: Yup.number().max(150000,"maximum 150000"),
      deferred_annuity: Yup.number().max(150000,"maximum 150000"),
      other:Yup.number().max(150000,"maximum 150000"),
      others:Yup.number().max(150000,"maximum 150000"),
    }),
    onSubmit: async (values: any) => {
      console.log(values);
      
      try {
        const empData = JSON.parse(localStorage.getItem("session") || "");
        const data = new FormData();
      console.log(data, "ggggg");
      let emp_pan = values.emp_pan;
      let house_rent = values.house_rent;
      let residence = values.residence;
      let rent_file = values.rent_file;
      let medic_insur_prem_80d = values.medic_insur_prem_80d;
      let chapter_vi_a_file = values.chapter_vi_a_file;
      let handicap_depend_80dd = values.handicap_depend_80dd;
      let high_edu_loan_80e = values.high_edu_loan_80e;
      let paid_rent_80gg = values.paid_rent_80gg;
      let handicap_80u = values.handicap_80u;
      let raj_gandhi_scheme_80ccg = values.raj_gandhi_scheme_80ccg;
      let int_on_saving_80tta = values.int_on_saving_80tta;
      let other_deduct = values.other_deduct;
      let pf_jeevan_suraksha = values.pf_jeevan_suraksha;
      let deduct_80c_file = values.deduct_80c_file;
      let lic = values.lic;
      let deferred_annuity = values.deferred_annuity;
      let public_pf = values.public_pf;
      let ulip_uti_lic = values.ulip_uti_lic;
      let housing_loan_repay = values.housing_loan_repay;
      let pf_uti_mutual_fund = values.pf_uti_mutual_fund;
      let invest_elss = values.invest_elss;
      let child_tution_fee = values.child_tution_fee;
      let deposit_home_looan_sch = values.deposit_home_looan_sch;
      let five_yrs_bank_deposit = values.five_yrs_bank_deposit;
      let other = values.other;
      let others = values.others;
      let annuity_pension_plan = values.annuity_pension_plan;
      let deduct_80ccc_file = values.deduct_80ccc_file;
      let emp_contri = values.emp_contri;
      let deduct_80cc_file = values.deduct_80cc_file;
      let notif_pens_sch = values.notif_pens_sch;
      let deduct_80ccd_file = values.deduct_80ccd_file;
      let int_house_loaan = values.int_house_loaan;
      let deduct_us24_file = values.deduct_us24_file;
      let int_loan_const_acco = values.int_loan_const_acco;
      data.append("rent_file", values.rent_file);
      data.append("chapter_vi_a_file", values.chapter_vi_a_file);
      data.append("deduct_80c_file", values.deduct_80c_file);
      data.append("deduct_80ccc_file", values.deduct_80ccc_file);
      data.append("deduct_80cc_file", values.deduct_80cc_file);
      data.append("deduct_80ccd_file", values.deduct_80ccd_file);
      data.append("deduct_us24_file", values.deduct_us24_file);

      const response: any = await axios.post(
        `/api/upload/old_itd_file?&emp_pan=${emp_pan}&house_rent=${house_rent}&residence=${residence}&rent_file=${rent_file}&medic_insur_prem_80d=${medic_insur_prem_80d}&chapter_vi_a_file=${chapter_vi_a_file}&handicap_depend_80dd=${handicap_depend_80dd}&high_edu_loan_80e=${high_edu_loan_80e}&paid_rent_80gg=${paid_rent_80gg}&handicap_80u=${handicap_80u}&raj_gandhi_scheme_80ccg=${raj_gandhi_scheme_80ccg}&int_on_saving_80tta=${int_on_saving_80tta}&other_deduct=${other_deduct}&pf_jeevan_suraksha=${pf_jeevan_suraksha}&deduct_80c_file=${deduct_80c_file}&lic=${lic}&deferred_annuity=${deferred_annuity}&public_pf=${public_pf}&ulip_uti_lic=${ulip_uti_lic}&housing_loan_repay=${housing_loan_repay}&pf_uti_mutual_fund=${pf_uti_mutual_fund}&invest_elss=${invest_elss}&child_tution_fee=${child_tution_fee}&deposit_home_looan_sch=${deposit_home_looan_sch}&five_yrs_bank_deposit=${five_yrs_bank_deposit}&other=${other}&others=${others}&annuity_pension_plan=${annuity_pension_plan}&deduct_80ccc_file=${deduct_80ccc_file}&emp_contri=${emp_contri}&deduct_80cc_file=${deduct_80cc_file}&notif_pens_sch=${notif_pens_sch}&deduct_80ccd_file=${deduct_80ccd_file}&int_house_loaan=${int_house_loaan}&deduct_us24_file=${deduct_us24_file}&int_loan_const_acco=${int_loan_const_acco}&emp_id=${empData.emp_id}`,
        data,
        {
          headers: { "content-type": "multipart/form-data" },
        }
      );
      console.log(response,'888');
      
      toast.success("ITD Submitted Successfully");
      } catch (error:any) {
        toast.error(error.response.data.results);
      }
    },
  });


  
  useEffect(() => {
    const fetchEmp = async () => {
      const empData = JSON.parse(localStorage.getItem("session") || "");
      setLocalData(empData);
    };
    fetchEmp();
  }, []);
  return (
    <>
      <ITDWrapper>
        <Card>
          <Card.Body className="p-0">
            <Card.Title className="text-center">
              INCOME TAX DECLARATION FORM
            </Card.Title>
            <Row>
              <Col>
                <Form
                  onSubmit={formik.handleSubmit}
                  encType="multipart/form-data"
                >
                  <Tabs activeKey={currentTab} id="controlled-tab-example">
                    <Tab eventKey={0} title="One" disabled={currentTab !== 0}>
                      <Table responsive bordered hover>
                        <tbody>
                          <tr>
                            <td colSpan={2}>Emp ID</td>
                            <td>
                              <Form.Control
                                type="text"
                                name="emp_id"
                                defaultValue={getlocdata?.emp_id}
                                disabled
                              />
                            </td>

                            <td colSpan={2}>PAN of Employee(compulsory)</td>
                            <td>
                              <Form.Control
                                type="text"
                                name="emp_pan"
                                required
                                value={formik.values?.emp_pan}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                            </td>
                          </tr>

                          <tr>
                            <td>ITEMS</td>
                            <td colSpan={2}>PARTICULARS</td>
                            <td>MAX LIMIT</td>
                            <td>DECLARED AMOUNT</td>
                            <td></td>
                          </tr>
                          <tr>
                            <td>DEDUCTION U/S 10</td>
                            <td colSpan={2}></td>
                            <td></td>
                            <td></td>
                            <td></td>
                          </tr>
                          <tr>
                            <td>HOUSE RENT</td>
                            <td colSpan={2}>
                              I am staying in a rented house and I agree to
                              submit Leave &amp;
                              <br />
                              Licence A&apos;ment when required.The Rent Paid is
                              (Rs.
                              <br />
                              _____________ X _______ months) &amp; the house is
                              located in
                              <br />a METRO / NON METRO (Tick whichever is
                              applicable)
                            </td>
                            <td></td>
                            <td>
                              <Form.Control
                                type="number"
                                className="mb-3"
                                name="house_rent"
                                value={formik.values.house_rent}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}

                              />
                              <Form.Group as={Col} controlId="formGridState">
                                <Form.Select
                                  name="residence"
                                  defaultValue="Choose..."
                                  required
                                  value={formik.values.residence}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                                >
                                  <option>Choose...</option>
                                  <option value="NON METRO">NON METRO</option>
                                  <option value="METRO">METRO</option>
                                </Form.Select>
                              </Form.Group>
                            </td>
                            <td className="uploadSlip">
                              {/* <div className="overlay">
                                <FontAwesomeIcon
                                  icon={Icons.faCloudUpload}
                                  size="1x"
                                  className="icon"
                                />

                              </div> */}

                              <Form.Control
                                type="file"
                                name="rent_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("rent_file",e.currentTarget?.files[0])}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td></td>
                            <td colSpan={2}></td>
                            <td>Max Limit</td>
                            <td>Declared Amount</td>
                            <td></td>
                          </tr>
                          <tr>
                            <td rowSpan={8} style={{ verticalAlign: "middle" }}>
                              DEDUCTION UNDER CHAPTER - VI A
                            </td>
                            <td colSpan={2}>
                              Sec 80D - Medical Insurance Premium (If the policy
                              covers a<br />
                              senior citizen then exemption is Rs.50,000/-)
                            </td>
                            <td style={{ textAlign: "right" }}>-</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="medic_insur_prem_80d"
                                value={formik.values.medic_insur_prem_80d}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                            </td>
                            <td rowSpan={8} className="uploadSlip">
                              <Form.Control
                                type="file"
                                name="chapter_vi_a_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("chapter_vi_a_file",e.currentTarget?.files[0])}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>
                              Sec 80DD - Handicapped Dependent
                            </td>
                            <td style={{ textAlign: "right" }}>-</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="handicap_depend_80dd"
                                value={formik.values.handicap_depend_80dd}
                                onChange={formik.handleChange}
                                onBlur={formik.handleBlur}
                                    />
                                  </td>
                                 
                          </tr>
                          <tr>
                            <td colSpan={2}>
                              Sec 80E - Repayment of Loan for higher education
                              (only Interest)
                            </td>
                            <td style={{ textAlign: "right" }}>-</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="high_edu_loan_80e"
                                value={formik.values.high_edu_loan_80e}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>Sec 80GG - Rent Paid</td>
                            <td style={{ textAlign: "right" }}>60,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="paid_rent_80gg"
                                value={formik.values.paid_rent_80gg}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                {formik.touched.paid_rent_80gg && formik.errors.paid_rent_80gg && (
                          <p className=" text-danger erroruser">
                            {formik.errors.paid_rent_80gg}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>Sec 80U - Handicapped</td>
                            <td style={{ textAlign: "right" }}>-</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="handicap_80u"
                                value={formik.values.handicap_80u}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>
                              Sec 80CCG - Rajeev Gandhi Equity Saving Scheme
                              <br />
                              (Investment max upto Rs.50,000, would get a
                              deduction of 50% on
                              <br />
                              the amount invested)
                            </td>
                            <td style={{ textAlign: "right" }}>25,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="raj_gandhi_scheme_80ccg"
                                value={formik.values.raj_gandhi_scheme_80ccg}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.raj_gandhi_scheme_80ccg && formik.errors.raj_gandhi_scheme_80ccg && (
                          <p className=" text-danger erroruser">
                            {formik.errors.raj_gandhi_scheme_80ccg}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>
                              Sec 80TTA / 80TTB - Interest on saving a/c
                            </td>
                            <td style={{ textAlign: "right" }}>
                              10000 / 50000
                            </td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="int_on_saving_80tta"
                                value={formik.values.int_on_saving_80tta}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.int_on_saving_80tta && formik.errors.int_on_saving_80tta && (
                          <p className=" text-danger erroruser">
                            {formik.errors.int_on_saving_80tta}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td colSpan={2}>
                              Any other Deduction (Please specify)
                            </td>
                            <td></td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="other_deduct"
                                value={formik.values.other_deduct}
                                onChange={formik.handleChange}
                                onBlur={formik.handleBlur}
                              />
                            </td>
                          </tr>
                        </tbody>
                      </Table>
                    </Tab>

                    <Tab eventKey={1} title="Two" disabled={currentTab !== 1}>
                      <Table responsive bordered hover>
                        <tbody>
                          <tr>
                            <td></td>
                            <td></td>
                            <td>Max Limit</td>
                            <td>Declared Amount</td>
                            <td></td>
                          </tr>
                          <tr>
                            <td
                              rowSpan={13}
                              style={{ verticalAlign: "middle" }}
                            >
                              DEDUCTION U/S 80C
                            </td>

                            <td>
                              Contribution to Pension Fund (Jeevan Suraksha)
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="pf_jeevan_suraksha"
                                value={formik.values.pf_jeevan_suraksha}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.pf_jeevan_suraksha && formik.errors.pf_jeevan_suraksha && (
                          <p className=" text-danger erroruser">
                            {formik.errors.pf_jeevan_suraksha}
                          </p>
                        )}
                            </td>
                            <td rowSpan={13} className="uploadSlip">
                              <Form.Control
                                type="file"
                                name="deduct_80c_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("deduct_80c_file",e.currentTarget?.files[0])}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Life Insurance Premium on life of
                              self/spouse/child only
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="lic"
                                value={formik.values.lic}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.lic && formik.errors.lic && (
                          <p className=" text-danger erroruser">
                            {formik.errors.lic}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>Deferred Annuity</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="deferred_annuity"
                                value={formik.values.deferred_annuity}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.deferred_annuity && formik.errors.deferred_annuity && (
                          <p className=" text-danger erroruser">
                            {formik.errors.deferred_annuity}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Public Provident Fund in own name/spouse/child
                              only
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="public_pf"
                                value={formik.values.public_pf}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.public_pf && formik.errors.public_pf && (
                          <p className=" text-danger erroruser">
                            {formik.errors.public_pf}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              ULIP of UTI/LIC in own name or spouse and child
                              only
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="ulip_uti_lic"
                                value={formik.values.ulip_uti_lic}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.ulip_uti_lic && formik.errors.ulip_uti_lic && (
                          <p className=" text-danger erroruser">
                            {formik.errors.ulip_uti_lic}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>Repayment of Housing Loan (Only principal)</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="housing_loan_repay"
                                value={formik.values.housing_loan_repay}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.housing_loan_repay && formik.errors.housing_loan_repay && (
                          <p className=" text-danger erroruser">
                            {formik.errors.housing_loan_repay}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Contribution to Pension Fund or UTI or Notified
                              Mutual Fund
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="pf_uti_mutual_fund"
                                value={formik.values.pf_uti_mutual_fund}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.pf_uti_mutual_fund && formik.errors.pf_uti_mutual_fund && (
                          <p className=" text-danger erroruser">
                            {formik.errors.pf_uti_mutual_fund}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Investment in ELSS made in units of Notified
                              Mutual Fund
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="invest_elss"
                                value={formik.values.invest_elss}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.invest_elss && formik.errors.invest_elss && (
                          <p className=" text-danger erroruser">
                            {formik.errors.invest_elss}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Children Tuition Fee: Restricted to a max of 2
                              Children
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="child_tution_fee"
                                value={formik.values.child_tution_fee}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.child_tution_fee && formik.errors.child_tution_fee && (
                          <p className=" text-danger erroruser">
                            {formik.errors.child_tution_fee}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>
                              Deposit in home loan account scheme of NHB/HDFC
                            </td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="deposit_home_looan_sch"
                                value={formik.values.deposit_home_looan_sch}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                    {formik.touched.deposit_home_looan_sch && formik.errors.deposit_home_looan_sch && (
                          <p className=" text-danger erroruser">
                            {formik.errors.deposit_home_looan_sch}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>5 yrs. Term deposit in a Sch.Bank</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="five_yrs_bank_deposit"
                                value={formik.values.five_yrs_bank_deposit}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.five_yrs_bank_deposit && formik.errors.five_yrs_bank_deposit && (
                          <p className=" text-danger erroruser">
                            {formik.errors.five_yrs_bank_deposit}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>Others (please specify)</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="other"
                                value={formik.values.other}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.other && formik.errors.other && (
                          <p className=" text-danger erroruser">
                            {formik.errors.other}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>Others (please specify)</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="others"
                                value={formik.values.others}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.others && formik.errors.others && (
                          <p className=" text-danger erroruser">
                            {formik.errors.others}
                          </p>
                        )}
                            </td>
                          </tr>
                          <tr>
                            <td>DEDUCTION U/S 80CCC</td>
                            <td>Annuity/Pension Plan</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="annuity_pension_plan"
                                value={formik.values.annuity_pension_plan}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.annuity_pension_plan && formik.errors.annuity_pension_plan && (
                          <p className=" text-danger erroruser">
                            {formik.errors.annuity_pension_plan}
                          </p>
                        )}
                            </td>
                            <td>
                              <Form.Control
                                type="file"
                                name="deduct_80ccc_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("deduct_80ccc_file",e.currentTarget?.files[0])}
                              />
                            </td>
                          </tr>
                          <tr>
                            <td>DEDUCTION U/S 80CC (1b)</td>
                            <td>Employee Contribution</td>
                            <td style={{ textAlign: "right" }}>50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="emp_contri"
                                value={formik.values.emp_contri}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.emp_contri && formik.errors.emp_contri && (
                          <p className=" text-danger erroruser">
                            {formik.errors.emp_contri}
                          </p>
                        )}
                            </td>
                            <td>
                              <Form.Control
                                type="file"
                                name="deduct_80cc_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("deduct_80cc_file",e.currentTarget?.files[0])}

                              />
                            </td>
                          </tr>
                          <tr>
                            <td>DEDUCTION U/S 80CCD</td>
                            <td>Notified Pension Scheme</td>
                            <td style={{ textAlign: "right" }}>1,50,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="notif_pens_sch"
                                value={formik.values.notif_pens_sch}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.notif_pens_sch && formik.errors.notif_pens_sch && (
                          <p className=" text-danger erroruser">
                            {formik.errors.notif_pens_sch}
                          </p>
                        )}
                            </td>
                            <td>
                              <Form.Control
                                type="file"
                                name="deduct_80ccd_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("deduct_80ccd_file",e.currentTarget?.files[0])}

                              />
                            </td>
                          </tr>
                          <tr>
                            <td
                              colSpan={5}
                              style={{
                                textAlign: "center",
                                fontWeight: "bold",
                              }}
                            >
                              Aggregate Deduction U/S 80C, 80CCC & 80CCD cannot
                              exceed Rs. 150000/- Additional Deduction U/S 80CCD
                              (1b) of Rs. 50000/-
                            </td>
                          </tr>

                          <tr>
                            <td></td>
                            <td></td>
                            <td>Max Limit</td>
                            <td>Declared Amount</td>
                            <td></td>
                          </tr>
                          <tr>
                            <td rowSpan={4} style={{ verticalAlign: "middle" }}>
                              DEDUCTION U/S 24
                            </td>
                            <td>
                              Interest on Housing Loan on fully constructed
                              accomodation only
                            </td>
                            <td>200,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="int_house_loaan"
                                value={formik.values.int_house_loaan}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.int_house_loaan && formik.errors.int_house_loaan && (
                          <p className=" text-danger erroruser">
                            {formik.errors.int_house_loaan}
                          </p>
                        )}
                            </td>
                            <td rowSpan={2} className="uploadSlip">
                              <Form.Control
                                type="file"
                                name="deduct_us24_file"
                                size="sm"
                                onChange={(e:any)=>formik.setFieldValue("deduct_us24_file",e.currentTarget?.files[0])}

                              />
                            </td>
                          </tr>

                          <tr>
                            <td>
                              Interest if the loan is taken before 01/04/99 on
                              fully constructed accomodation only.
                            </td>
                            <td>30,000.00</td>
                            <td>
                              <Form.Control
                                type="text"
                                className="mb-3"
                                name="int_loan_const_acco"
                                value={formik.values.int_loan_const_acco}
                          onChange={formik.handleChange}
                          onBlur={formik.handleBlur}
                              />
                                        {formik.touched.int_loan_const_acco && formik.errors.int_loan_const_acco && (
                          <p className=" text-danger erroruser">
                            {formik.errors.int_loan_const_acco}
                          </p>
                        )}
                            </td>
                          </tr>
                        </tbody>
                      </Table>

                      <Button variant="outline-primary" type="submit" size="sm">
                        Submit
                      </Button>
                    </Tab>
                  </Tabs>
                  <Stack
                    gap={3}
                    direction="horizontal"
                    className="mt-3"
                    style={{ float: "right" }}
                  >
                    <Button
                      variant="outline-dark"
                      size="sm"
                      disabled={currentTab === 0}
                      onClick={() => setCurrentTab((prev) => prev - 1)}
                    >
                      Prev
                    </Button>
                    <Button
                      variant="outline-dark"
                      size="sm"
                      disabled={currentTab === 1}
                      onClick={() => setCurrentTab((prev) => prev + 1)}
                    >
                      Next
                    </Button>
                  </Stack>
                </Form>
              </Col>
            </Row>
          </Card.Body>
        </Card>
      </ITDWrapper>
    </>
  );
};

export default OldRegime;
