cleaning up frontend code

This commit is contained in:
Abhimanyu Yadav
2025-06-04 11:22:46 +05:30
parent 5b45d246ef
commit 8312a339c2
10 changed files with 6 additions and 30 deletions

View File

@@ -108,7 +108,6 @@ export function BlockMenuStateProvider({
integrations: 0,
marketplace_agents: 0,
my_agents: 0,
providers: 0,
});
const [loadingSlug, setLoadingSlug] = useState<string | null>(null);

View File

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

View File

@@ -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;

View File

@@ -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>
);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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);
}