refactor(block-menu): consolidate block content components into PaginatedBlocksContent for improved maintainability

This commit is contained in:
Abhimanyu Yadav
2025-06-17 21:57:18 +05:30
parent 9206d24017
commit e63575877d
4 changed files with 10 additions and 24 deletions

View File

@@ -1,6 +0,0 @@
import React from "react";
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
export const ActionBlocksContent = () => {
return <PaginatedBlocksContent blockRequest={{ type: "action" }} />;
};

View File

@@ -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 />}

View File

@@ -1,6 +0,0 @@
import React from "react";
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
export const InputBlocksContent = () => {
return <PaginatedBlocksContent blockRequest={{ type: "input" }} />;
};

View File

@@ -1,6 +0,0 @@
import React from "react";
import { PaginatedBlocksContent } from "./PaginatedBlocksContent";
export const OutputBlocksContent = () => {
return <PaginatedBlocksContent blockRequest={{ type: "output" }} />;
};