mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
re-structure to monorepo.
This commit is contained in:
19
packages/webapp/src/containers/Homepage/components.tsx
Normal file
19
packages/webapp/src/containers/Homepage/components.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
// @ts-nocheck
|
||||
import { isEmpty } from 'lodash';
|
||||
import { useAbilityContext } from '@/hooks';
|
||||
|
||||
export const useFilterShortcutBoxesSection = (section) => {
|
||||
const ability = useAbilityContext();
|
||||
|
||||
return section
|
||||
.map(({ sectionTitle, shortcuts }) => {
|
||||
const shortcut = shortcuts.filter((shortcuts) => {
|
||||
return ability.can(shortcuts.ability, shortcuts.subject);
|
||||
});
|
||||
return {
|
||||
sectionTitle: sectionTitle,
|
||||
shortcuts: shortcut,
|
||||
};
|
||||
})
|
||||
.filter(({ shortcuts }) => !isEmpty(shortcuts));
|
||||
};
|
||||
Reference in New Issue
Block a user