diff --git a/canvas/src/components/CreateWorkspaceDialog.tsx b/canvas/src/components/CreateWorkspaceDialog.tsx index 9c5f4dd0..37e1231d 100644 --- a/canvas/src/components/CreateWorkspaceDialog.tsx +++ b/canvas/src/components/CreateWorkspaceDialog.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useEffect, useRef, useCallback } from "react"; +import { useState, useEffect, useRef, useCallback, useId } from "react"; import * as Dialog from "@radix-ui/react-dialog"; import { api } from "@/lib/api"; @@ -42,6 +42,7 @@ export function CreateWorkspaceButton() { const [tier, setTier] = useState(1); const [template, setTemplate] = useState(""); const [parentId, setParentId] = useState(""); + const [budgetLimit, setBudgetLimit] = useState(""); const [creating, setCreating] = useState(false); const [error, setError] = useState(null); const [workspaces, setWorkspaces] = useState([]); @@ -87,6 +88,7 @@ export function CreateWorkspaceButton() { setTier(1); setTemplate(""); setParentId(""); + setBudgetLimit(""); setError(null); setHermesProvider("anthropic"); setHermesApiKey(""); @@ -113,12 +115,17 @@ export function CreateWorkspaceButton() { : undefined; try { + const parsedBudget = budgetLimit.trim() + ? parseFloat(budgetLimit) + : null; + await api.post("/workspaces", { name: name.trim(), role: role.trim() || undefined, template: template.trim() || undefined, tier, parent_id: parentId || undefined, + budget_limit: parsedBudget, canvas: { x: Math.random() * 400 + 100, y: Math.random() * 300 + 100 }, ...(isHermes && provider ? { secrets: { [provider.envVar]: hermesApiKey.trim() } } @@ -182,6 +189,14 @@ export function CreateWorkspaceButton() { onChange={setRole} placeholder="e.g. SEO Specialist" /> + -