"use client"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { CheckCircle, XCircle, Loader2, GitBranch, GitPullRequest, Bug, FilePlus2, Archive, } from "lucide-react"; import { useRouter } from "next/navigation"; import { ThreadDisplayInfo } from "./types"; import { TerminalInput } from "./terminal-input"; import { useFileUpload } from "@/hooks/useFileUpload"; import { cn } from "@/lib/utils"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../ui/tooltip"; import { Label } from "../ui/label"; import { ContentBlocksPreview } from "../thread/ContentBlocksPreview"; import { ThemeToggle } from "../theme-toggle"; import { ThreadCard, ThreadCardLoading } from "./thread-card"; import { QuickActions } from "./quick-actions"; import { useState } from "react"; interface DefaultViewProps { threads: ThreadDisplayInfo[]; threadsLoading: boolean; } export function DefaultView({ threads, threadsLoading }: DefaultViewProps) { const router = useRouter(); const [quickActionPrompt, setQuickActionPrompt] = useState(""); const apiUrl: string | undefined = process.env.NEXT_PUBLIC_API_URL ?? ""; const assistantId: string | undefined = process.env.NEXT_PUBLIC_MANAGER_ASSISTANT_ID ?? ""; const { contentBlocks, setContentBlocks, handleFileUpload, dropRef, removeBlock, dragOver, handlePaste, } = useFileUpload(); if (!apiUrl || !assistantId) { return
Missing API URL or Assistant ID
; } return (
{/* Header */}
Open SWE
ready
{/* Main Content */}
{/* Terminal Chat Input */}
Attach files
{/* Recent & Running Threads */}

Recent & Running Threads

{threadsLoading || threads.length ? (
{threadsLoading && threads.length === 0 && ( <> )} {threads.slice(0, 4).map((thread) => ( ))}
) : (
No threads found
)}
); }