import React from 'react'; import { FastField, Field } from 'formik'; import { FormGroup, Checkbox } from '@blueprintjs/core'; import styled from 'styled-components'; import { FormattedMessage as T } from 'components'; import { Row, Col, FieldHint } from '../../../components'; import { handlePreviousYearCheckBoxChange, handlePreviousPeriodCheckBoxChange, handlePreviousYearChangeCheckboxChange, handlePreviousYearPercentageCheckboxChange, handlePreviousPeriodChangeCheckboxChange, handlePreviousPeriodPercentageCheckboxChange, } from './utils'; /** * ProfitLoss sheet header -comparison panel. */ export default function ProfitLossSheetHeaderComparisonPanel() { return ( {/**----------- Previous Year -----------*/} {({ form, field }) => ( }> } {...field} onChange={handlePreviousYearCheckBoxChange(form)} /> )} {({ form, field }) => ( }> } {...field} onChange={handlePreviousYearChangeCheckboxChange(form)} /> )} {({ form, field }) => ( }> } {...field} onChange={handlePreviousYearPercentageCheckboxChange(form)} /> )} {/**----------- Previous Period (PP) -----------*/} {({ form, field }) => ( }> } {...field} onChange={handlePreviousPeriodCheckBoxChange(form)} /> )} {({ form, field }) => ( }> } {...field} onChange={handlePreviousPeriodChangeCheckboxChange(form)} /> )} {({ form, field }) => ( }> } {...field} onChange={handlePreviousPeriodPercentageCheckboxChange(form)} /> )} {/**----------- % of Column -----------*/} {({ field }) => ( }> } {...field} /> )} {/**----------- % of Row -----------*/} {({ field }) => ( }> } {...field} /> )} {/**----------- % of Expense -----------*/} {({ field }) => ( }> } {...field} /> )} {/**----------- % of Income -----------*/} {({ field }) => ( }> } {...field} /> )} ); } const ProfitLossSheetComparisonWrap = styled.div` .row { margin-left: 0.15rem; .col { min-width: 150px !important; max-width: 190px !important; } } .bp3-form-group { margin-bottom: 3px; } `;