"use client"; import { useState } from "react"; import { Settings, X } from "lucide-react"; type SettingsModalProps = { systemPrompt: string; onSystemPromptChange: (prompt: string) => void; selectedModel: string | null; models: Array<{ id: string; name: string; device: string }>; design?: { chatLayout: "compact" | "edge"; bubbleSize: "sm" | "md" | "lg"; onChange: (next: Partial<{ chatLayout: "compact" | "edge"; bubbleSize: "sm" | "md" | "lg" }>) => void; }; }; export function SettingsModal({ systemPrompt, onSystemPromptChange, selectedModel, models, design, }: SettingsModalProps) { const [isOpen, setIsOpen] = useState(false); const [tempPrompt, setTempPrompt] = useState(systemPrompt); const [tempChatLayout, setTempChatLayout] = useState<"compact" | "edge">(design?.chatLayout ?? "compact"); const [tempBubbleSize, setTempBubbleSize] = useState<"sm" | "md" | "lg">(design?.bubbleSize ?? "md"); const selectedModelData = models.find((m) => m.id === selectedModel); const handleSave = () => { onSystemPromptChange(tempPrompt); if (design?.onChange) { design.onChange({ chatLayout: tempChatLayout, bubbleSize: tempBubbleSize }); } setIsOpen(false); }; const handleCancel = () => { setTempPrompt(systemPrompt); setIsOpen(false); }; return ( <> {/* Botão de Configurações */} {/* Modal */} {isOpen && (
Controla se o conteúdo do chat é centralizado com largura máxima ou ocupa toda a largura.
Ajusta paddings e tipografia das bolhas de mensagem.