mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
WIP Make journal entries page.
This commit is contained in:
@@ -1,24 +1,36 @@
|
||||
import React from 'react';
|
||||
import React, {useCallback} from 'react';
|
||||
import AccountsSelectList from 'components/AccountsSelectList';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
FormGroup,
|
||||
Classes,
|
||||
Intent,
|
||||
} from '@blueprintjs/core';
|
||||
|
||||
// Account cell renderer.
|
||||
const AccountCellRenderer = ({
|
||||
column: { id, value },
|
||||
row: { index, original },
|
||||
payload: { accounts }
|
||||
payload: { accounts, updateData, errors },
|
||||
}) => {
|
||||
const handleAccountSelected = useCallback((account) => {
|
||||
updateData(index, id, account.id);
|
||||
}, [updateData, index, id]);
|
||||
|
||||
const { account_id = false } = (errors[index] || {});
|
||||
|
||||
return (
|
||||
<FormGroup
|
||||
className={classNames('form-group--select-list',
|
||||
'form-group--account', Classes.FILL)}
|
||||
intent={account_id ? Intent.DANGER : ''}
|
||||
className={classNames(
|
||||
'form-group--select-list',
|
||||
'form-group--account',
|
||||
Classes.FILL)}
|
||||
>
|
||||
<AccountsSelectList
|
||||
accounts={accounts}
|
||||
onAccountSelected={() => {}} />
|
||||
onAccountSelected={handleAccountSelected}
|
||||
error={account_id} />
|
||||
</FormGroup>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user