2022-06-21 15:01:41 +00:00
|
|
|
import { difference } from 'lodash'
|
|
|
|
|
2022-07-13 21:11:22 +00:00
|
|
|
export const CATEGORIES_GROUP_SLUG_POSTFIX = '-default'
|
2022-07-20 05:23:00 +00:00
|
|
|
|
2022-05-12 15:07:10 +00:00
|
|
|
export const CATEGORIES = {
|
|
|
|
politics: 'Politics',
|
|
|
|
technology: 'Technology',
|
|
|
|
science: 'Science',
|
|
|
|
world: 'World',
|
2022-05-16 03:44:47 +00:00
|
|
|
sports: 'Sports',
|
2022-05-12 15:07:10 +00:00
|
|
|
economics: 'Economics',
|
2022-05-16 03:44:47 +00:00
|
|
|
personal: 'Personal',
|
|
|
|
culture: 'Culture',
|
|
|
|
manifold: 'Manifold',
|
|
|
|
covid: 'Covid',
|
2022-05-12 15:07:10 +00:00
|
|
|
crypto: 'Crypto',
|
2022-05-16 03:44:47 +00:00
|
|
|
gaming: 'Gaming',
|
|
|
|
fun: 'Fun',
|
2022-06-21 15:01:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type category = keyof typeof CATEGORIES
|
2022-05-12 15:07:10 +00:00
|
|
|
|
|
|
|
export const TO_CATEGORY = Object.fromEntries(
|
|
|
|
Object.entries(CATEGORIES).map(([k, v]) => [v, k])
|
|
|
|
)
|
|
|
|
|
|
|
|
export const CATEGORY_LIST = Object.keys(CATEGORIES)
|
2022-06-21 15:01:41 +00:00
|
|
|
|
2022-07-13 21:11:22 +00:00
|
|
|
export const EXCLUDED_CATEGORIES: category[] = [
|
|
|
|
'fun',
|
|
|
|
'manifold',
|
|
|
|
'personal',
|
|
|
|
'covid',
|
|
|
|
'culture',
|
|
|
|
'gaming',
|
|
|
|
'crypto',
|
|
|
|
'world',
|
|
|
|
]
|
2022-06-21 15:01:41 +00:00
|
|
|
|
2022-07-13 21:11:22 +00:00
|
|
|
export const DEFAULT_CATEGORIES = difference(CATEGORY_LIST, EXCLUDED_CATEGORIES)
|
2022-07-20 05:23:00 +00:00
|
|
|
|
|
|
|
export const DEFAULT_CATEGORY_GROUPS = DEFAULT_CATEGORIES.map((c) => ({
|
|
|
|
slug: c.toLowerCase() + CATEGORIES_GROUP_SLUG_POSTFIX,
|
|
|
|
name: CATEGORIES[c as category],
|
|
|
|
}))
|