import { Announcement } from '../api/announcement/types' import { getId } from '../utils/auth' import { FiltersType } from '../utils/filters' const userCategories = ['givingOut', 'needDispose'] as const type UserCategory = typeof userCategories[number] const UserCategoriesNames: Record = { givingOut: 'Раздача', needDispose: 'Нужно утилизировать', } const userCategoriesInfos: Record string> = { givingOut: (ann: Announcement) => ( `Годен до ${ann.bestBy}` ), needDispose: (ann: Announcement) => ( `Было заинтересно ${ann.bookedBy} чел.` ), } const composeUserCategoriesFilters: Record FiltersType> = { givingOut: () => ({ userId: getId(), obsolete: false, }), needDispose: () => ({ userId: getId(), obsolete: true, }), } export type { UserCategory } export { userCategories, UserCategoriesNames, userCategoriesInfos, composeUserCategoriesFilters }