refactor: Update TextInput class to include "peer" for styling consistency
This commit is contained in:
@@ -933,4 +933,29 @@ export const TagList = [
|
||||
'inhuman', 'nonhuman', 'non-human-character', 'not-human'
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
export const searchTagList = (query:string) => {
|
||||
const splited = query.split(',').map(v => v.trim())
|
||||
if(splited.length > 10){
|
||||
return []
|
||||
}
|
||||
const realQuery = splited.at(-1).trim().toLowerCase()
|
||||
|
||||
let result = []
|
||||
|
||||
for(const tag of TagList){
|
||||
if(tag.value.startsWith(realQuery)){
|
||||
result.push(tag.value)
|
||||
continue
|
||||
}
|
||||
for(const alias of tag.alias){
|
||||
if(alias.startsWith(realQuery)){
|
||||
result.push(tag.value)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.filter(v => splited.indexOf(v) === -1)
|
||||
}
|
||||
Reference in New Issue
Block a user