import { useState } from 'react' import { Button, Flex, HStack, Stack } from '@chakra-ui/react' import { UploadButton } from '../buttons/UploadButton' import { GiphySearchForm } from './GiphySearchForm' import { useTypebot } from 'contexts/TypebotContext' import { Input } from '../Textbox/Input' import { EmojiSearchableList } from './emoji/EmojiSearchableList' type Props = { url?: string isEmojiEnabled?: boolean isGiphyEnabled?: boolean onSubmit: (url: string) => void onClose?: () => void } export const ImageUploadContent = ({ url, onSubmit, isEmojiEnabled = false, isGiphyEnabled = true, onClose, }: Props) => { const [currentTab, setCurrentTab] = useState< 'link' | 'upload' | 'giphy' | 'emoji' >(isEmojiEnabled ? 'emoji' : 'upload') const handleSubmit = (url: string) => { onSubmit(url) onClose && onClose() } return ( {isEmojiEnabled && ( )} {isGiphyEnabled && ( )} ) } const BodyContent = ({ tab, url, onSubmit, }: { tab: 'upload' | 'link' | 'giphy' | 'emoji' url?: string onSubmit: (url: string) => void }) => { switch (tab) { case 'upload': return case 'link': return case 'giphy': return case 'emoji': return } } type ContentProps = { initialUrl?: string; onNewUrl: (url: string) => void } const UploadFileContent = ({ onNewUrl }: ContentProps) => { const { typebot } = useTypebot() return ( Choose an image ) } const EmbedLinkContent = ({ initialUrl, onNewUrl }: ContentProps) => ( ) const GiphyContent = ({ onNewUrl }: ContentProps) => ( )