feat: optimize expense and manual journal details status.

This commit is contained in:
a.bouhuolia
2021-12-21 18:10:58 +02:00
parent 5429643db5
commit a456b9d942
5 changed files with 79 additions and 20 deletions

View File

@@ -1,8 +1,8 @@
import intl from 'react-intl-universal';
import React from 'react';
import { Classes, Tooltip, Position } from '@blueprintjs/core';
import { Tag, Intent, Classes, Tooltip, Position } from '@blueprintjs/core';
import { FormatNumberCell, If, Icon } from '../../../components';
import { T, Choose, FormatNumberCell, If, Icon } from '../../../components';
/**
* Note column accessor.
@@ -22,6 +22,27 @@ export function NoteAccessor(row) {
);
}
/**
* Publish column accessor.
*/
export function ManualJournalDetailsStatus({ manualJournal }) {
return (
<Choose>
<Choose.When condition={!!manualJournal.is_published}>
<Tag minimal={true} round={true}>
<T id={'published'} />
</Tag>
</Choose.When>
<Choose.Otherwise>
<Tag intent={Intent.WARNING} round={true}>
<T id={'draft'} />
</Tag>
</Choose.Otherwise>
</Choose>
);
}
/**
* Retrieve read-only manual journal entries columns.
*/