feat: empty status ability.

This commit is contained in:
elforjani13
2021-11-24 11:47:18 +02:00
parent cc1f4cc26b
commit aef8eb7907
11 changed files with 213 additions and 143 deletions

View File

@@ -2,7 +2,8 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'components';
import { Can, FormattedMessage as T } from 'components';
import { Item_Abilities, AbilitySubject } from '../../common/abilityOption';
export default function ItemsEmptyStatus() {
const history = useHistory();
@@ -17,19 +18,21 @@ export default function ItemsEmptyStatus() {
}
action={
<>
<Button
intent={Intent.PRIMARY}
large={true}
onClick={() => {
history.push('/items/new');
}}
>
<T id={'new_item'} />
</Button>
<Can I={Item_Abilities.Create} a={AbilitySubject.Item}>
<Button
intent={Intent.PRIMARY}
large={true}
onClick={() => {
history.push('/items/new');
}}
>
<T id={'new_item'} />
</Button>
<Button intent={Intent.NONE} large={true}>
<T id={'learn_more'} />
</Button>
<Button intent={Intent.NONE} large={true}>
<T id={'learn_more'} />
</Button>
</Can>
</>
}
/>