wwf
8 天以前 938c3e5a587ce950a94964ea509b9e7f8834dfae
1
2
3
4
5
6
7
8
9
10
11
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
}