mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add defaultStatusFilters
This commit is contained in:
parent
32c0d81bff
commit
969a7a75e1
1 changed files with 24 additions and 0 deletions
|
|
@ -35,6 +35,30 @@ const statusesByIcon = Object.keys( statuses ).reduce( ( acc, key ) => {
|
|||
return acc
|
||||
}, {} )
|
||||
|
||||
|
||||
export const statusFilterPrefix = 'status'
|
||||
|
||||
export const statusFilterSeparator = '_'
|
||||
|
||||
|
||||
// Example:
|
||||
// {
|
||||
// label: '✅ Native Support',
|
||||
// query: 'status_native'
|
||||
// },
|
||||
export const defaultStatusFilters = Object.keys( statuses ).reduce( ( acc, key ) => {
|
||||
const status = statuses[ key ]
|
||||
acc[ statusFilterPrefix + statusFilterSeparator + key ] = status.filterLabel
|
||||
|
||||
acc = [...acc, {
|
||||
label: `${ status.icon } ${ status.filterLabel }`,
|
||||
query: statusFilterPrefix + statusFilterSeparator + status.snakeSlug
|
||||
}]
|
||||
return acc
|
||||
}, [] )
|
||||
|
||||
|
||||
|
||||
export function getStatusName ( status ) {
|
||||
for (const key in statusesByIcon) {
|
||||
if (status.trim().startsWith( key )) return statusesByIcon[key]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue