mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat(branches& warehouses): add empty status.
This commit is contained in:
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
||||
|
||||
import { DataTable } from 'components';
|
||||
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
||||
import BranchesEmptyStatus from './BranchesEmptyStatus';
|
||||
import { useBranchesTableColumns, ActionsMenu } from './components';
|
||||
import { useBranchesContext } from './BranchesProvider';
|
||||
|
||||
@@ -24,6 +25,8 @@ function BranchesDataTable({
|
||||
// Table columns.
|
||||
const columns = useBranchesTableColumns();
|
||||
|
||||
const Time = true;
|
||||
|
||||
const { branches, isBranchesLoading, isBranchesFetching } =
|
||||
useBranchesContext();
|
||||
|
||||
@@ -35,6 +38,10 @@ function BranchesDataTable({
|
||||
openAlert('branch-delete', { branchId: id });
|
||||
};
|
||||
|
||||
if (Time) {
|
||||
return <BranchesEmptyStatus />;
|
||||
}
|
||||
|
||||
return (
|
||||
<BranchesTable
|
||||
columns={columns}
|
||||
|
||||
42
src/containers/Preferences/Branches/BranchesEmptyStatus.js
Normal file
42
src/containers/Preferences/Branches/BranchesEmptyStatus.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Button, Intent } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, EmptyStatus } from '../../../components';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
function BranchesEmptyStatus({
|
||||
// #withDialogActions
|
||||
openDialog,
|
||||
}) {
|
||||
// Handle activate action branch.
|
||||
const handleActivateBranch = () => {
|
||||
openDialog('branch-activate', {});
|
||||
};
|
||||
|
||||
return (
|
||||
<EmptyStatus
|
||||
title={'Id enim irure laborum laboris do'}
|
||||
description={
|
||||
'Commodo fugiat officia commodo proident officia excepteur proident anim. Eu sunt enim aute exercitation est. Dolore occaecat tempor elit commodo duis ipsum amet est quis. Est commodo laborum in nisi deserunt dolor ipsum.'
|
||||
}
|
||||
action={
|
||||
<React.Fragment>
|
||||
<Button
|
||||
intent={Intent.PRIMARY}
|
||||
large={true}
|
||||
onClick={handleActivateBranch}
|
||||
>
|
||||
<T id={'activate'} />
|
||||
</Button>
|
||||
|
||||
<Button intent={Intent.NONE} large={true}>
|
||||
<T id={'learn_more'} />
|
||||
</Button>
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
export default compose(withDialogActions)(BranchesEmptyStatus);
|
||||
Reference in New Issue
Block a user