/
proposal-filter.store.ts
36 lines (35 loc) · 1.28 KB
/
proposal-filter.store.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { BooleanFilterOption, OrderOption } from '@core/utils/enums/filters'
import { writable, Writable } from 'svelte/store'
import { ProposalFilter, ProposalStatus, ProposalType, ProposalOrderOption } from '..'
export const proposalFilter: Writable<ProposalFilter> = writable({
phase: {
active: false,
type: 'selection',
labelKey: 'filters.phase.label',
localeKey: 'pills.proposalStatus',
selected: ProposalStatus.Commencing,
choices: [ProposalStatus.Commencing, ProposalStatus.Upcoming, ProposalStatus.Holding, ProposalStatus.Ended],
},
type: {
active: false,
type: 'selection',
localeKey: 'filters.proposalType',
selected: ProposalType.Official,
choices: [ProposalType.Official, ProposalType.Custom],
},
participated: {
active: false,
type: 'selection',
localeKey: 'filters.participated',
selected: BooleanFilterOption.Yes,
choices: [BooleanFilterOption.Yes, BooleanFilterOption.No],
},
order: {
active: false,
type: 'order',
localeKey: 'filters.proposalOrder',
selected: ProposalOrderOption.Name,
ascDesc: OrderOption.Asc,
choices: [ProposalOrderOption.Name, ProposalOrderOption.Phase],
},
})