// Copyright 2025 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { useCallback, useState } from 'react'; import { Button } from 'react-aria-components'; import { action } from '@storybook/addon-actions'; import { type ComponentMeta } from '../../storybook/types'; import type { FunEmojiPickerProps } from './FunEmojiPicker'; import { FunEmojiPicker } from './FunEmojiPicker'; import { MOCK_RECENT_EMOJIS, MOCK_THIS_MESSAGE_EMOJIS } from './mocks'; import { FunProvider } from './FunProvider'; import { packs, recentStickers } from '../stickers/mocks'; import { EmojiSkinTone } from './data/emojis'; import { Select } from '../Select'; const { i18n } = window.SignalContext; type TemplateProps = Omit< FunEmojiPickerProps, 'open' | 'onOpenChange' | 'children' >; const skinToneOptions = [ { value: EmojiSkinTone.None, text: 'Default' }, { value: EmojiSkinTone.Type1, text: 'Light Skin Tone' }, { value: EmojiSkinTone.Type2, text: 'Medium-Light Skin Tone' }, { value: EmojiSkinTone.Type3, text: 'Medium Skin Tone' }, { value: EmojiSkinTone.Type4, text: 'Medium-Dark Skin Tone' }, { value: EmojiSkinTone.Type5, text: 'Dark Skin Tone' }, ]; function Template(props: TemplateProps): JSX.Element { const [open, setOpen] = useState(true); const [skinTone, setSkinTone] = useState(EmojiSkinTone.None); const handleOpenChange = useCallback((openState: boolean) => { setOpen(openState); }, []); const handleSkinToneChange = useCallback((value: string) => { setSkinTone(value as EmojiSkinTone); }, []); return ( null} onSelectEmoji={action('onSelectEmoji')} // Stickers installedStickerPacks={packs} showStickerPickerHint={false} onClearStickerPickerHint={() => null} onSelectSticker={() => null} // Gifs fetchGifsSearch={() => Promise.reject()} fetchGifsFeatured={() => Promise.reject()} fetchGif={() => Promise.reject()} onSelectGif={() => null} >