mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
cleaning up frontend code
This commit is contained in:
@@ -108,7 +108,6 @@ export function BlockMenuStateProvider({
|
||||
integrations: 0,
|
||||
marketplace_agents: 0,
|
||||
my_agents: 0,
|
||||
providers: 0,
|
||||
});
|
||||
|
||||
const [loadingSlug, setLoadingSlug] = useState<string | null>(null);
|
||||
|
||||
@@ -70,7 +70,7 @@ const AllBlocksContent: React.FC = () => {
|
||||
return (
|
||||
<div className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200">
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{[0, 1, 3].map((categoryIndex) => (
|
||||
{Array.from({ length: 3 }).map((_, categoryIndex) => (
|
||||
<Fragment key={categoryIndex}>
|
||||
{categoryIndex > 0 && (
|
||||
<Skeleton className="my-4 h-[1px] w-full text-zinc-100" />
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import React from "react";
|
||||
import Block from "../Block";
|
||||
|
||||
interface BlockListSkeletonProps {
|
||||
count?: number;
|
||||
}
|
||||
|
||||
const BlockListSkeleton: React.FC<BlockListSkeletonProps> = ({ count = 3 }) => {
|
||||
return (
|
||||
<>
|
||||
{Array.from({ length: count }).map((_, index) => (
|
||||
<Block.Skeleton key={index} />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlockListSkeleton;
|
||||
@@ -7,9 +7,7 @@ const BlockMenuDefault: React.FC = () => {
|
||||
return (
|
||||
<div className="flex flex-1 overflow-y-auto">
|
||||
<BlockMenuSidebar />
|
||||
|
||||
<Separator className="h-full w-[1px] text-zinc-300" />
|
||||
|
||||
<BlockMenuDefaultContent />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -88,7 +88,7 @@ const BlockMenuSidebar: React.FC = ({}) => {
|
||||
onClick={() => setDefaultState(item.type as DefaultStateType)}
|
||||
/>
|
||||
))}
|
||||
<div className="ml-[0.5365rem] border-l border-black/10 pl-[0.75rem]">
|
||||
<div className="ml-[0.5365rem] space-y-2 border-l border-black/10 pl-[0.75rem]">
|
||||
{subMenuItems.map((item) => (
|
||||
<MenuItem
|
||||
key={item.type}
|
||||
|
||||
@@ -42,7 +42,7 @@ const IntegrationBlocks: React.FC = ({}) => {
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="w-full space-y-3 p-4">
|
||||
{[0, 1, 3].map((blockIndex) => (
|
||||
{Array.from({ length: 3 }).map((_, blockIndex) => (
|
||||
<Fragment key={blockIndex}>
|
||||
{blockIndex > 0 && (
|
||||
<Skeleton className="my-4 h-[1px] w-full text-zinc-100" />
|
||||
|
||||
@@ -30,7 +30,7 @@ const MarketplaceAgentsContent: React.FC = () => {
|
||||
className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200"
|
||||
>
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{[0, 1, 2, 3, 4].map((index) => (
|
||||
{Array.from({ length: 5 }).map((_, index) => (
|
||||
<MarketplaceAgentBlock.Skeleton key={index} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ const MyAgentsContent: React.FC = () => {
|
||||
className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200"
|
||||
>
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{[0, 1, 2, 3, 4].map((index) => (
|
||||
{Array.from({ length: 5 }).map((_, index) => (
|
||||
<UGCAgentBlock.Skeleton key={index} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@ const PaginatedIntegrationList: React.FC = () => {
|
||||
className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200"
|
||||
>
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{[0, 1, 3, 4, 5].map((integrationIndex) => (
|
||||
{Array.from({ length: 6 }).map((_, integrationIndex) => (
|
||||
<Integration.Skeleton key={integrationIndex} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,6 @@ const BlockMenuSearch: React.FC = ({}) => {
|
||||
}
|
||||
|
||||
try {
|
||||
// Prepare filter array from active categories
|
||||
const activeCategories = Object.entries(filters.categories)
|
||||
.filter(([_, isActive]) => isActive)
|
||||
.map(([category, _]) => category)
|
||||
@@ -58,10 +57,8 @@ const BlockMenuSearch: React.FC = ({}) => {
|
||||
setCategoryCounts(response.total_items);
|
||||
|
||||
if (isLoadMore) {
|
||||
console.log("search list : ", response.items);
|
||||
setSearchData((prev) => [...prev, ...response.items]);
|
||||
} else {
|
||||
console.log("initial list : ", response.items);
|
||||
setSearchData(response.items);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user