You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/web/utils/emoji.ts

12 lines
303 B
TypeScript

import { SearchIndex } from 'emoji-mart'
import type { Emoji } from '@emoji-mart/data'
export async function searchEmoji(value: string) {
const emojis: Emoji[] = await SearchIndex.search(value) || []
const results = emojis.map((emoji) => {
return emoji.skins[0].native
})
return results
}