feat: add ForkModal to MyTreesPage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import { usePermissions } from '@/hooks/usePermissions'
|
|||||||
import { toast } from '@/lib/toast'
|
import { toast } from '@/lib/toast'
|
||||||
import { AIFlowBuilderModal } from '@/components/ai-builder/AIFlowBuilderModal'
|
import { AIFlowBuilderModal } from '@/components/ai-builder/AIFlowBuilderModal'
|
||||||
import { aiBuilderApi } from '@/api/aiBuilder'
|
import { aiBuilderApi } from '@/api/aiBuilder'
|
||||||
|
import { ForkModal } from '@/components/library/ForkModal'
|
||||||
|
|
||||||
interface TreeWithStats extends TreeListItem {
|
interface TreeWithStats extends TreeListItem {
|
||||||
lastUsed?: string
|
lastUsed?: string
|
||||||
@@ -36,6 +37,7 @@ export function MyTreesPage() {
|
|||||||
const [showCreateMenu, setShowCreateMenu] = useState(false)
|
const [showCreateMenu, setShowCreateMenu] = useState(false)
|
||||||
const [showAIBuilder, setShowAIBuilder] = useState(false)
|
const [showAIBuilder, setShowAIBuilder] = useState(false)
|
||||||
const [aiEnabled, setAiEnabled] = useState(false)
|
const [aiEnabled, setAiEnabled] = useState(false)
|
||||||
|
const [forkTarget, setForkTarget] = useState<TreeWithStats | null>(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadMyTrees()
|
loadMyTrees()
|
||||||
@@ -354,6 +356,14 @@ export function MyTreesPage() {
|
|||||||
>
|
>
|
||||||
<Share2 className="h-4 w-4" />
|
<Share2 className="h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setForkTarget(tree)}
|
||||||
|
className="rounded-md border border-border p-2 text-muted-foreground hover:bg-accent hover:text-foreground transition-colors"
|
||||||
|
title="Fork flow"
|
||||||
|
>
|
||||||
|
<GitBranch className="h-4 w-4" />
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -401,6 +411,15 @@ export function MyTreesPage() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Fork Modal */}
|
||||||
|
{forkTarget && (
|
||||||
|
<ForkModal
|
||||||
|
treeId={forkTarget.id}
|
||||||
|
treeName={forkTarget.name}
|
||||||
|
onClose={() => setForkTarget(null)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* AI Flow Builder Modal */}
|
{/* AI Flow Builder Modal */}
|
||||||
<AIFlowBuilderModal
|
<AIFlowBuilderModal
|
||||||
isOpen={showAIBuilder}
|
isOpen={showAIBuilder}
|
||||||
|
|||||||
Reference in New Issue
Block a user