Files
bigcapital/src/containers/FinancialStatements/BalanceSheet/BalanceSheetHeaderComparisonPanal.js
2022-01-13 16:25:46 +02:00

161 lines
4.6 KiB
JavaScript

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';
/**
* Balance sheet header - Comparison panal.
*/
export default function BalanceSheetHeaderComparisonPanal() {
return (
<BalanceSheetComparisonWrap>
{/*------------ Percentage -----------*/}
<Row>
<Col xs={3}>
<FastField name={'percentage_of_column'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.percentage_of_column'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField name={'percentage_of_row'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.percentage_of_row'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
</Row>
{/*------------ Previous Year -----------*/}
<Row>
<Col xs={3}>
<FastField name={'previous_year'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.previous_year'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField name={'previous_year_amount_change'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.total_change'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField name={'previous_year_percentage_change'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.change'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
</Row>
{/*------------ Previous Period -----------*/}
<Row>
<Col xs={3}>
<FastField name={'previous_period'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.previous_period'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField name={'previous_period_amount_change'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.total_change'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField
name={'previous_period_percentage_change'}
type={'checkbox'}
>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.change'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
</Row>
</BalanceSheetComparisonWrap>
);
}
const BalanceSheetComparisonWrap = styled.div`
.row {
display: flex;
flex-wrap: nowrap;
margin-left: -0.3rem;
margin-right: -0.3rem;
.col {
padding-left: 0.3rem;
padding-right: 0.3rem;
.bp3-form-group {
margin-bottom: 0;
}
}
}
`;