mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
refactor(block-menu): simplify useEffect dependencies in AllBlocksContent, IntegrationBlocks, and SuggestionContent components
This commit is contained in:
@@ -38,7 +38,7 @@ export const AllBlocksContent: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
fetchBlocks();
|
||||
}, [api, fetchBlocks]);
|
||||
}, [fetchBlocks]);
|
||||
|
||||
const fetchMoreBlockOfACategory = async (category: string) => {
|
||||
try {
|
||||
@@ -68,7 +68,7 @@ export const AllBlocksContent: React.FC = () => {
|
||||
|
||||
if (loading) {
|
||||
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="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{Array.from({ length: 3 }).map((_, categoryIndex) => (
|
||||
<Fragment key={categoryIndex}>
|
||||
@@ -98,7 +98,7 @@ export 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="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
|
||||
<div className="w-full space-y-3 px-4 pb-4">
|
||||
{categories.map((category, index) => (
|
||||
<Fragment key={category.name}>
|
||||
|
||||
@@ -37,7 +37,7 @@ export const IntegrationBlocks: React.FC = ({}) => {
|
||||
|
||||
useEffect(() => {
|
||||
fetchBlocks();
|
||||
}, [api, integration, fetchBlocks]);
|
||||
}, [fetchBlocks]);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
|
||||
@@ -37,7 +37,7 @@ export const SuggestionContent: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
fetchSuggestions();
|
||||
}, [api, fetchSuggestions]);
|
||||
}, [fetchSuggestions]);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
@@ -52,7 +52,7 @@ export const SuggestionContent: 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="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
|
||||
<div className="w-full space-y-6 pb-4">
|
||||
{/* Recent Searches */}
|
||||
{/* <div className="-mb-2 space-y-2.5">
|
||||
|
||||
Reference in New Issue
Block a user