import React from 'react'; import moment from 'moment'; import { Buffer } from 'buffer'; import './Form.scss'; class SquarePdf extends React.Component { constructor(props) { super(props); this.state = {}; } render() { return ( <>
RCCA |   {this.props.id}
Problem Statement Action
{' '} IS :
{this.props?.getReports?.at(0)?.rccaD1DescProblem?.rddp_act_problem}
Should be :
{this.props?.getReports?.at(0)?.rccaD1DescProblem?.rddp_should_be}

{this.props?.getReports?.at(0)?.rccaD1DescProblem?.attachments?.at(0)?.data ? ( {this.props?.getReports?.at(0)?.rccaD1DescProblem?.attachments?.at(0)?.name} ) : null}
Corrective : {this.props?.getReports?.at(0)?.rccaD5CorrectActions.map((rccaD5, index) => (
{index + 1} ) {rccaD5?.rca_actions} (PIC :  {rccaD5?.rca_pic}; ECD :   {moment(rccaD5?.rca_action_date).format('DD-MMM-YY')})
))}
Mitigation : {this.props?.getReports?.at(0)?.rccaD6RiskMitigations.map((rccaD6, index) => (
{index + 1} ) {rccaD6?.rrm_actions} (PIC :  {rccaD6?.rrm_pic}; ECD :   {moment(rccaD6?.rrm_action_date).format('DD-MMM-YY')})
))}
Cause Verification
Direct Root Cause : {this.props?.getReports?.at(0)?.rccaD4ProblemRootCauses.map((rccaD4, index) => rccaD4?.rrc_rootcause_type == 'Direct' ? (
{index + 1} ) {rccaD4?.rrc_rootcause}
) : ( '' ) )}
Escapee Root Cause : {this.props?.getReports?.at(0)?.rccaD4ProblemRootCauses.map((rccaD4, index) => rccaD4?.rrc_rootcause_type == 'Escapee' ? (
{index + 1} ) {rccaD4?.rrc_rootcause}
) : ( '' ) )}

Systemic Root Cause :
{this.props?.getReports?.at(0)?.rccaD4ProblemRootCauses.map((rccaD4, index) => rccaD4?.rrc_rootcause_type == 'Systemic' ? (
{index + 1} ) {rccaD4?.rrc_rootcause}
) : ( '' ) )}
{this.props?.getReports?.at(0)?.rccaD7MonitorPlans.map((rccaD7, index) => (
{index + 1} ) {rccaD7?.rmp_monitoring_plan_action}
PIC :   {this.props?.getReports?.at(0)?.rcca_mrb_chairman}
ECD :   {moment(rccaD7?.rmp_mrb_validation_date).format('DD-MMM-YY')}
))}
); } } export default SquarePdf;