mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
refactor(block-menu): consolidate block content components into PaginatedBlocksContent for improved maintainability
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
import React from "react";
|
||||
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
|
||||
|
||||
export const ActionBlocksContent = () => {
|
||||
return <PaginatedBlocksContent blockRequest={{ type: "action" }} />;
|
||||
};
|
||||
@@ -4,10 +4,8 @@ import { AllBlocksContent } from "./AllBlocksContent";
|
||||
import { IntegrationsContent } from "./IntegrationsContent";
|
||||
import { MarketplaceAgentsContent } from "./MarketplaceAgentsContent";
|
||||
import { MyAgentsContent } from "./MyAgentsContent";
|
||||
import { ActionBlocksContent } from "./ActionBlocksContent";
|
||||
import { InputBlocksContent } from "./InputBlocksContent";
|
||||
import { OutputBlocksContent } from "./OutputBlocksContent";
|
||||
import { useBlockMenuContext } from "../block-menu-provider";
|
||||
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
|
||||
|
||||
export interface ActionBlock {
|
||||
id: number;
|
||||
@@ -28,9 +26,15 @@ export const BlockMenuDefaultContent = () => {
|
||||
<div className="h-full flex-1 overflow-hidden">
|
||||
{defaultState == "suggestion" && <SuggestionContent />}
|
||||
{defaultState == "all_blocks" && <AllBlocksContent />}
|
||||
{defaultState == "input_blocks" && <InputBlocksContent />}
|
||||
{defaultState == "action_blocks" && <ActionBlocksContent />}
|
||||
{defaultState == "output_blocks" && <OutputBlocksContent />}
|
||||
{defaultState == "input_blocks" && (
|
||||
<PaginatedBlocksContent blockRequest={{ type: "input" }} />
|
||||
)}
|
||||
{defaultState == "action_blocks" && (
|
||||
<PaginatedBlocksContent blockRequest={{ type: "action" }} />
|
||||
)}
|
||||
{defaultState == "output_blocks" && (
|
||||
<PaginatedBlocksContent blockRequest={{ type: "output" }} />
|
||||
)}
|
||||
{defaultState == "integrations" && <IntegrationsContent />}
|
||||
{defaultState == "marketplace_agents" && <MarketplaceAgentsContent />}
|
||||
{defaultState == "my_agents" && <MyAgentsContent />}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import React from "react";
|
||||
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
|
||||
|
||||
export const InputBlocksContent = () => {
|
||||
return <PaginatedBlocksContent blockRequest={{ type: "input" }} />;
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
import React from "react";
|
||||
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
|
||||
|
||||
export const OutputBlocksContent = () => {
|
||||
return <PaginatedBlocksContent blockRequest={{ type: "output" }} />;
|
||||
};
|
||||
Reference in New Issue
Block a user