import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { RefreshCw, Copy, Check, Play, Loader2 } from "lucide-react" import { useState } from "react" import { invoke } from "@tauri-apps/api/core" export function StoppedCard({ onCheckAgain }: { onCheckAgain: () => void }) { const [copied, setCopied] = useState(false); const [starting, setStarting] = useState(false); const command = "ollama serve"; const handleCopy = () => { navigator.clipboard.writeText(command); setCopied(true); setTimeout(() => setCopied(false), 2000); }; const handleStart = async () => { setStarting(true); try { await invoke('start_ollama_server'); // Wait a bit for the server to start before checking again setTimeout(() => { onCheckAgain(); setStarting(false); }, 3000); } catch (error) { console.error("Failed to start ollama:", error); setStarting(false); } }; return ( Ollama está parado O Ollama está instalado mas não está rodando. Você pode iniciá-lo automaticamente ou executar o comando manualmente.
Ou manualmente
{command}
) }