import { Collapse, Form, Input, InputNumber, Switch, DatePicker } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import FormItemEmail from "../form-items-formatted/email-form-item.component";
import FormItemPhone from "../form-items-formatted/phone-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";

export default function JobsCreateJobsInfo({ form }) {
  const { t } = useTranslation();
  const { getFieldValue } = form;
  return (
    <div>
      <Collapse defaultActiveKey='insurance'>
        <Collapse.Panel
          key='insurance'
          header={t("menus.jobsdetail.insurance")}>
          <LayoutFormRow>
            <Form.Item label={t("jobs.fields.ins_co_id")} name='ins_co_id'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.policy_no")} name='policy_no'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.clm_no")} name='clm_no'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.regie_number")}
              name='regie_number'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.loss_date")} name='loss_date'>
              <DatePicker />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_co_nm")} name='ins_co_nm'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_addr1")} name='ins_addr1'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_city")} name='ins_city'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_ct_ln")} name='ins_ct_ln'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_ct_fn")} name='ins_ct_fn'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ins_ph1")} name='ins_ph1'>
              <FormItemPhone customInput={Input} />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.ins_ea")}
              name='ins_ea'
              rules={[
                {
                  type: "email",
                  message: "This is not a valid email address.",
                },
              ]}>
              <FormItemEmail email={getFieldValue("ins_ea")} />
            </Form.Item>
            Appraiser Info
            <Form.Item label={t("jobs.fields.est_co_nm")} name='est_co_nm'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.est_ct_fn")} name='est_ct_fn'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.est_ct_ln")} name='est_ct_ln'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.pay_date")} name='pay_date'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.est_ph1")} name='est_ph1'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.est_ea")}
              name='est_ea'
              rules={[
                {
                  type: "email",
                  message: "This is not a valid email address.",
                },
              ]}>
              <FormItemEmail email={getFieldValue("est_ea")} />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.selling_dealer")}
              name='selling_dealer'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.servicing_dealer")}
              name='servicing_dealer'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.selling_dealer_contact")}
              name='selling_dealer_contact'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.servicing_dealer_contact")}
              name='servicing_dealer_contact'>
              <Input />
            </Form.Item>
          </LayoutFormRow>
        </Collapse.Panel>
        <Collapse.Panel key='claim' header={t("menus.jobsdetail.claimdetail")}>
          <LayoutFormRow>
            <Form.Item label={t("jobs.fields.csr")} name='csr'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.loss_desc")} name='loss_desc'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ponumber")} name='po_number'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.unitnumber")} name='unit_number'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.specialcoveragepolicy")}
              valuePropName='checked'
              name='special_coverage_policy'>
              <Switch />
            </Form.Item>
            <Form.Item label={t("jobs.fields.kmin")} name='kmin'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.kmout")} name='kmout'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.referralsource")}
              name='referral_source'>
              <Input />
            </Form.Item>
          </LayoutFormRow>
          TODO How to handle different taxes and marking them as exempt?
          {
            // <Form.Item label={t("jobs.fields.exempt")}>
            //     {getFieldDecorator("exempt", {
            //       initialValue: job.exempt
            //     })(<Input name='exempt' />)}
            //   </Form.Item>
          }
        </Collapse.Panel>
        <Collapse.Panel
          key='financial'
          header={t("menus.jobsdetail.financials")}>
          <LayoutFormRow>
            <Form.Item label={t("jobs.fields.ded_amt")} name='ded_amt'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.ded_status")} name='ded_status'>
              <Input />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.depreciation_taxes")}
              name='depreciation_taxes'>
              <InputNumber />
            </Form.Item>
            TODO This is equivalent of GST payable.
            <Form.Item
              label={t("jobs.fields.federal_tax_payable")}
              name='federal_tax_payable'>
              <InputNumber />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.other_amount_payable")}
              name='other_amount_payable'>
              <InputNumber />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.towing_payable")}
              name='towing_payable'>
              <InputNumber />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.storage_payable")}
              name='storage_payable'>
              <InputNumber />
            </Form.Item>
            <Form.Item
              label={t("jobs.fields.adjustment_bottom_line")}
              name='adjustment_bottom_line'>
              <InputNumber />
            </Form.Item>
            Totals Table
            <Form.Item
              label={t("jobs.fields.labor_rate_desc")}
              name='labor_rate_desc'>
              <Input />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lab")} name='rate_lab'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lad")} name='rate_lad'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lae")} name='rate_lae'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lar")} name='rate_lar'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_las")} name='rate_las'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_laf")} name='rate_laf'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lam")} name='rate_lam'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lag")} name='rate_lag'>
              <InputNumber />
            </Form.Item>
            Note //TODO Remove ATP rate?
            <Form.Item label={t("jobs.fields.rate_atp")} name='rate_atp'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_lau")} name='rate_lau'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_la1")} name='rate_la1'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_la2")} name='rate_la2'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_la3")} name='rate_la3'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_la4")} name='rate_la4'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_mapa")} name='rate_mapa'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_mash")} name='rate_mash'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_mahw")} name='rate_mahw'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_ma2s")} name='rate_ma2s'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_ma3s")} name='rate_ma3s'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_mabl")} name='rate_mabl'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_macs")} name='rate_macs'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_matd")} name='rate_matd'>
              <InputNumber />
            </Form.Item>
            <Form.Item label={t("jobs.fields.rate_laa")} name='rate_laa'>
              <InputNumber />
            </Form.Item>
          </LayoutFormRow>
        </Collapse.Panel>
      </Collapse>
    </div>
  );
}
