import { Divider, Form, Input, DatePicker } from "antd";
import React, { useContext } from "react";
import { useTranslation } from "react-i18next";
import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context";
import FormItemEmail from "../form-items-formatted/email-form-item.component";
import FormItemPhone from "../form-items-formatted/phone-form-item.component";
import moment from "moment";
export default function JobsDetailInsurance({ job }) {
const form = useContext(JobDetailFormContext);
const { getFieldDecorator, getFieldValue } = form;
const { t } = useTranslation();
console.log("job.loss_date", job.loss_date);
return (
{getFieldDecorator("ins_co_id", {
initialValue: job.ins_co_id
})()}
{getFieldDecorator("policy_no", {
initialValue: job.policy_no
})()}
{getFieldDecorator("clm_no", {
initialValue: job.clm_no
})()}
{getFieldDecorator("regie_number", {
initialValue: job.regie_number
})()}
TODO: missing KOL field???
{getFieldDecorator("loss_date", {
initialValue: job.loss_date ? moment(job.loss_date) : null
})()}
DAMAGE {JSON.stringify(job.area_of_damage)}
CAA # seems not correct based on field mapping Class seems not correct
based on field mapping
{getFieldDecorator("ins_co_nm", {
initialValue: job.ins_co_nm
})()}
{getFieldDecorator("ins_addr1", {
initialValue: job.ins_addr1
})()}
{getFieldDecorator("ins_city", {
initialValue: job.ins_city
})()}
{getFieldDecorator("ins_ct_ln", {
initialValue: job.ins_ct_ln
})()}
{getFieldDecorator("ins_ct_fn", {
initialValue: job.ins_ct_fn
})()}
{getFieldDecorator("ins_ph1", {
initialValue: job.ins_ph1
})()}
{getFieldDecorator("ins_ea", {
initialValue: job.ins_ea,
rules: [
{
type: "email",
message: "This is not a valid email address."
}
]
})()}
Appraiser Info
{getFieldDecorator("est_co_nm", {
initialValue: job.est_co_nm
})()}
{getFieldDecorator("est_ct_fn", {
initialValue: job.est_ct_fn
})()}
{getFieldDecorator("est_ct_ln", {
initialValue: job.est_ct_ln
})()}
TODO: Field is pay date but title is inspection date. Likely incorrect?
{getFieldDecorator("pay_date", {
initialValue: job.pay_date
})()}
{getFieldDecorator("est_ph1", {
initialValue: job.est_ph1
})()}
{getFieldDecorator("est_ea", {
initialValue: job.est_ea,
rules: [
{
type: "email",
message: "This is not a valid email address."
}
]
})()}
{getFieldDecorator("selling_dealer", {
initialValue: job.selling_dealer
})()}
{getFieldDecorator("servicing_dealer", {
initialValue: job.servicing_dealer
})()}
{getFieldDecorator("selling_dealer_contact", {
initialValue: job.selling_dealer_contact
})()}
{getFieldDecorator("servicing_dealer_contact", {
initialValue: job.servicing_dealer_contact
})()}
TODO: Adding servicing/selling dealer contact info?
);
}