Repository: Significant-Gravitas/Auto-GPT
File: autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/page.tsx (TypeScript)

Code before:
    api
      .deepCloneLibraryAgent(agentID!)
      .then((newAgent) => {
        router.push(`/library/agents/${newAgent.id}`);
      })
      .catch((error) => {
        console.error("Error copying agent:", error);
        toast({
          title: "Error copying agent",
          description: `An error occurred while copying the agent: ${error.message}`,
          variant: "destructive",
        });
      });
  }, []);

  const agentActions: ButtonAction[] = useMemo(
    () => [
      ...(agent?.can_access_graph
        ? [
            {
              label: "Open graph in builder",
              href: `/build?flowID=${agent.graph_id}&flowVersion=${agent.graph_version}`,
            },
            { label: "Export agent to file", callback: downloadGraph },
            {
              label: "Edit a copy",
              callback: () => setCopyAgentDialogOpen(true),
            },
          ]
        : []),
      {
        label: "Delete agent",
        variant: "destructive",
        callback: () => setAgentDeleteDialogOpen(true),
      },
    ],
    [agent, downloadGraph],
  );

  if (!agent || !graph) {
    /* TODO: implement loading indicators / skeleton page */
    return <span>Loading...</span>;
  }

  return (
    <div className="container justify-stretch p-0 lg:flex">
      {/* Sidebar w/ list of runs */}
      {/* TODO: render this below header in sm and md layouts */}
      <AgentRunsSelectorList
        className="agpt-div w-full border-b lg:w-auto lg:border-b-0 lg:border-r"
        agent={agent}

Review comment (suggestion):
```suggestion
              label: "Create & edit a copy",
```
or

```suggestion
              label: "Copy & Edit",
```

cc @ograce1421 

Code after:
    api
      .forkLibraryAgent(agentID)
      .then((newAgent) => {
        router.push(`/library/agents/${newAgent.id}`);
      })
      .catch((error) => {
        console.error("Error copying agent:", error);
        toast({
          title: "Error copying agent",
          description: `An error occurred while copying the agent: ${error.message}`,
          variant: "destructive",
        });
      });
  }, [agentID, api, router, toast]);

  const agentActions: ButtonAction[] = useMemo(
    () => [
      ...(agent?.can_access_graph
        ? [
            {
              label: "Open graph in builder",
              href: `/build?flowID=${agent.graph_id}&flowVersion=${agent.graph_version}`,
            },
          ]
        : []),
      { label: "Export agent to file", callback: downloadGraph },
      {
        label: "Edit a copy",
        callback: () => setCopyAgentDialogOpen(true),
      },
      {
        label: "Delete agent",
        variant: "destructive",
        callback: () => setAgentDeleteDialogOpen(true),
      },
    ],
    [agent, downloadGraph],
  );

  if (!agent || !graph) {
    /* TODO: implement loading indicators / skeleton page */
    return <span>Loading...</span>;
  }

  return (
    <div className="container justify-stretch p-0 lg:flex">
      {/* Sidebar w/ list of runs */}
      {/* TODO: render this below header in sm and md layouts */}
      <AgentRunsSelectorList
        className="agpt-div w-full border-b lg:w-auto lg:border-b-0 lg:border-r"
        agent={agent}