vikunja-frontend/src/helpers/getNamespaceTitle.ts

16 lines
408 B
TypeScript
Raw Normal View History

2021-08-20 15:38:16 +02:00
import {i18n} from '@/i18n'
2022-09-06 11:36:01 +02:00
import type {INamespace} from '@/modelTypes/INamespace'
2021-08-20 15:38:16 +02:00
2022-07-21 00:42:36 +02:00
export const getNamespaceTitle = (n: INamespace) => {
if (n.id === -1) {
2021-08-20 15:38:16 +02:00
return i18n.global.t('namespace.pseudo.sharedLists.title')
}
if (n.id === -2) {
2021-08-20 15:38:16 +02:00
return i18n.global.t('namespace.pseudo.favorites.title')
}
if (n.id === -3) {
2021-08-20 15:38:16 +02:00
return i18n.global.t('namespace.pseudo.savedFilters.title')
}
2021-07-19 11:18:22 +02:00
return n.title
}