mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
30 lines
875 B
JavaScript
30 lines
875 B
JavaScript
import React from 'react';
|
|
import { FastField } from 'formik';
|
|
import classNames from 'classnames';
|
|
import { CLASSES } from 'common/classes';
|
|
import MakeJournalEntriesTable from './MakeJournalEntriesTable';
|
|
import { defaultEntry, MIN_LINES_NUMBER } from './utils';
|
|
|
|
/**
|
|
* Make journal entries field.
|
|
*/
|
|
export default function MakeJournalEntriesField() {
|
|
return (
|
|
<div className={classNames(CLASSES.PAGE_FORM_BODY)}>
|
|
<FastField name={'entries'}>
|
|
{({ form, field: { value }, meta: { error, touched } }) => (
|
|
<MakeJournalEntriesTable
|
|
onChange={(entries) => {
|
|
form.setFieldValue('entries', entries);
|
|
}}
|
|
entries={value}
|
|
defaultEntry={defaultEntry}
|
|
initialLinesNumber={MIN_LINES_NUMBER}
|
|
error={error}
|
|
/>
|
|
)}
|
|
</FastField>
|
|
</div>
|
|
);
|
|
}
|