vikunja-frontend/src/helpers/getNamespaceTitle.ts

16 lines
404 B
TypeScript
Raw Normal View History

2021-08-20 15:38:16 +02:00
import {i18n} from '@/i18n'
import NamespaceModel from '@/models/namespace'
2021-08-20 15:38:16 +02:00
export const getNamespaceTitle = (n: NamespaceModel) => {
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
}