/* eslint-disable jsx-a11y/no-autofocus */ import { useRef, useState } from 'react' import { Field } from 'formik' import { Picker } from 'emoji-mart' import useOutsideClick from '@utils/useOutsideClick' import 'emoji-mart/css/emoji-mart.css' const TextArea = ({ name, placeholder, theme='auto', setValue, value }:TextAreaProps):JSX.Element => { const ref = useRef() const [ emojiPickerHidden, setEmojiPickerHidden ] = useState(true) useOutsideClick(ref, () => { setEmojiPickerHidden(true) }) return
{ !emojiPickerHidden && { setEmojiPickerHidden(true) setValue(value + ' ' + ((e as { native: string }).native || e.colons)) }} i18n={{ search: '검색', notfound: '검색 결과가 없습니다.', categories: { search: '검색 결과', recent: '최근 사용', people: '사람', nature: '자연', foods: '음식', activity: '활동', places: '장소', objects: '사물', symbols: '기호', flags: '국기', custom: '커스텀' } }} custom={[{ name: '한국 디스코드봇 리스트', short_names: ['koreanbots', 'kbots', 'dbkr'], emoticons: [], keywords: ['koreanbots', '한국 디스코드봇 리스트', '한디리', 'kbots'], imageUrl: '/logo.png' }]}/> }
setEmojiPickerHidden(false)} onKeyPress={() => setEmojiPickerHidden(false)} role='button' tabIndex={0} />
} interface TextAreaProps { name: string placeholder?: string theme?: 'auto' | 'dark' | 'light' value: string setValue(value: string): void } export default TextArea