"use client"; import { useState } from "react"; import { CreateWorkspaceDialog } from "./create-workspace-dialog"; export function EmptyState({ workspaceExists, expectedPath, onWorkspaceCreated, }: { workspaceExists: boolean; /** The resolved workspace path to display (e.g. from the tree API). */ expectedPath?: string | null; /** Called after a workspace is created from this empty state. */ onWorkspaceCreated?: () => void; }) { const [showCreate, setShowCreate] = useState(false); return (
{/* Icon */}
{/* Text */}

{workspaceExists ? "Workspace is empty" : "No workspace found"}

{workspaceExists ? ( <> The workspace exists but has no knowledge tree yet. Ask the CRM agent to create objects and documents to populate it. ) : ( <> The workspace directory was not found. Create one to get started, or start a conversation and the agent will set it up automatically. )}

{/* Create workspace button — prominent when no workspace exists */} {!workspaceExists && ( )} {/* Hint */}
Expected location:{" "} {expectedPath ? expectedPath.replace(/^\/Users\/[^/]+/, "~") : "~/.openclaw/workspace"}
{/* Back link */} Back to Home {/* Create workspace dialog */} setShowCreate(false)} onCreated={onWorkspaceCreated} />
); }