"use client"; import React, { useState } from "react"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Maximize2, SwatchBookIcon, X } from "lucide-react"; import { ModelId, MODELS } from "@common/models-list"; import { useAtom, useAtomValue } from "jotai"; import { selectedModelIdAtom } from "@/atoms/user-settings-atom"; import { customModelIdsAtom } from "@/atoms/models-list-atom"; export default function SelectModel() { const [selectedModelId, setSelectedModelId] = useAtom(selectedModelIdAtom); console.log("🚀 => selectedModelId:", selectedModelId); const customModelIds = useAtomValue(customModelIdsAtom); const [open, setOpen] = useState(false); const [zoomedModel, setZoomedModel] = useState(null); const handleModelSelect = (model: ModelId | string) => { console.log("🚀 => model:", model); setSelectedModelId(model); setOpen(false); }; const handleZoom = (event: React.MouseEvent, model: ModelId) => { event.stopPropagation(); setZoomedModel(model); }; return (
Select AI Model
{Object.entries(MODELS).map((modelData) => { const modelId = modelData[0] as ModelId; const model = modelData[1]; return (
); })}

Imported Custom Models

{customModelIds.map((customModel) => { return ( ); })}
!open && setZoomedModel(null)} >
{`${MODELS[zoomedModel]?.name}
Before
{`${MODELS[zoomedModel]?.name}
After
); }