-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TenantOverview): add links to sections titles (#599)
- Loading branch information
1 parent
c31d048
commit 30401fa
Showing
13 changed files
with
192 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/containers/Tenant/Diagnostics/TenantOverview/getSectionTitle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {InternalLink} from '../../../../components/InternalLink/InternalLink'; | ||
|
||
import i18n from './i18n'; | ||
|
||
interface GetSectionTitleParams { | ||
entity: string; | ||
postfix: string; | ||
prefix?: string; | ||
link?: string; | ||
} | ||
|
||
// Titles are formed by the principle "Top entities by parameter" | ||
export const getSectionTitle = ({ | ||
prefix = i18n('top'), | ||
entity, | ||
postfix, | ||
link, | ||
}: GetSectionTitleParams) => { | ||
if (link) { | ||
return ( | ||
<> | ||
{prefix} <InternalLink to={link}>{entity}</InternalLink> {postfix} | ||
</> | ||
); | ||
} | ||
|
||
return `${prefix} ${entity} ${postfix}`; | ||
}; |
Oops, something went wrong.