import { useContext, useState } from "react"; import { MessageDetail } from "@/chatgpt"; import { Tr } from "@/translate"; import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/components/ui/drawer"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { AppChatStoreContext, AppContext } from "@/pages/App"; import { PaintBucketIcon } from "lucide-react"; interface Props { disableFactor: boolean[]; } interface ImageResponse { url?: string; b64_json?: string; revised_prompt: string; } export function ImageGenDrawer({ disableFactor }: Props) { const { chatStore, setChatStore } = useContext(AppChatStoreContext); const [showGenImage, setShowGenImage] = useState(false); const [imageGenPrompt, setImageGenPrompt] = useState(""); const [imageGenModel, setImageGenModel] = useState("dall-e-3"); const [imageGenN, setImageGenN] = useState(1); const [imageGenQuality, setImageGEnQuality] = useState("standard"); const [imageGenResponseFormat, setImageGenResponseFormat] = useState("b64_json"); const [imageGenSize, setImageGenSize] = useState("1024x1024"); const [imageGenStyle, setImageGenStyle] = useState("vivid"); const [imageGenGenerating, setImageGenGenerating] = useState(false); useState("b64_json"); return ( <> {chatStore.image_gen_api && chatStore.image_gen_key ? ( Generate images using the DALL-E model.
Generate Image