mirror of
https://github.com/langgenius/dify.git
synced 2026-07-23 21:15:32 -04:00
a84c2d36a3
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
12 lines
306 B
TypeScript
12 lines
306 B
TypeScript
import type { Emoji } from '@emoji-mart/data'
|
|
import { SearchIndex } from 'emoji-mart'
|
|
|
|
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
|
|
}
|