Skip to content

Commit 003d550

Browse files
authored
♻️ Refactor DocxGrid.tsx
Use a map to make the code more readable
1 parent c11d59c commit 003d550

File tree

1 file changed

+5
-6
lines changed
  • src/frontend/apps/impress/src/features/docs/docs-grid/components

1 file changed

+5
-6
lines changed

src/frontend/apps/impress/src/features/docs/docs-grid/components/DocsGrid.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ export const DocsGrid = ({
4646
void fetchNextPage();
4747
};
4848

49-
const title =
50-
target === DocDefaultFilter.MY_DOCS
51-
? t('My docs')
52-
: target === DocDefaultFilter.SHARED_WITH_ME
53-
? t('Shared with me')
54-
: t('All docs');
49+
const title = {
50+
[DocDefaultFilter.MY_DOCS]: t('My docs'),
51+
[DocDefaultFilter.SHARED_WITH_ME]: t('Shared with me'),
52+
[DocDefaultFilter.ALL_DOCS]: t('All docs'),
53+
}[target]
5554

5655
return (
5756
<Box

0 commit comments

Comments
 (0)