mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: add style of bill.
This commit is contained in:
49
src/containers/Drawers/BillDrawer/BillGLEntriesTable.js
Normal file
49
src/containers/Drawers/BillDrawer/BillGLEntriesTable.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Card } from 'components';
|
||||
|
||||
import { useTransactionsByReference } from 'hooks/query';
|
||||
import { useBillDrawerContext } from './BillDrawerProvider';
|
||||
|
||||
import JournalEntriesTable, {
|
||||
AmountDisplayedBaseCurrencyMessage,
|
||||
} from '../../JournalEntriesTable/JournalEntriesTable';
|
||||
|
||||
/**
|
||||
* Bill GL entries table.
|
||||
* @returns {React.JSX}
|
||||
*/
|
||||
export default function BillGLEntriesTable() {
|
||||
const { billId } = useBillDrawerContext();
|
||||
|
||||
// Handle fetch transaction by reference.
|
||||
const {
|
||||
data: { transactions },
|
||||
isLoading: isTransactionLoading,
|
||||
} = useTransactionsByReference(
|
||||
{
|
||||
reference_id: billId,
|
||||
reference_type: 'Bill',
|
||||
},
|
||||
{ enabled: !!billId },
|
||||
);
|
||||
|
||||
return (
|
||||
<BilleGLEntriesRoot>
|
||||
<AmountDisplayedBaseCurrencyMessage />
|
||||
<BillGLEntriesDatatable
|
||||
loading={isTransactionLoading}
|
||||
transactions={transactions}
|
||||
/>
|
||||
</BilleGLEntriesRoot>
|
||||
);
|
||||
}
|
||||
|
||||
const BilleGLEntriesRoot = styled(Card)``;
|
||||
|
||||
const BillGLEntriesDatatable = styled(JournalEntriesTable)`
|
||||
.table .tbody .tr:last-child .td {
|
||||
border-bottom: 0;
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user