mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix comments
This commit is contained in:
@@ -9,7 +9,6 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
icon_url?: string;
|
||||
}
|
||||
|
||||
// Define the component type with Skeleton property
|
||||
interface IntegrationChipComponent extends React.FC<Props> {
|
||||
Skeleton: React.FC;
|
||||
}
|
||||
@@ -45,7 +44,6 @@ const IntegrationChip: IntegrationChipComponent = ({
|
||||
);
|
||||
};
|
||||
|
||||
// Skeleton subcomponent
|
||||
const IntegrationChipSkeleton: React.FC = () => {
|
||||
return (
|
||||
<Skeleton className="flex h-[3.25rem] w-full min-w-[7.5rem] gap-2 rounded-[0.5rem] bg-zinc-100 p-2 pr-3">
|
||||
|
||||
@@ -7,7 +7,7 @@ const ActionBlocksContent: React.FC = () => {
|
||||
const [blocks, setBlocks] = useState<BlockListType[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchBlocks = async () => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -20,7 +20,7 @@ const AllBlocksContent: React.FC = () => {
|
||||
const [categories, setCategories] = useState<BlockCategory[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchBlocks = async () => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -13,61 +13,93 @@ const BlockMenuSidebar: React.FC<BlockMenuSidebarProps> = ({
|
||||
setDefaultState,
|
||||
setIntegration,
|
||||
}) => {
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
const topLevelMenuItems = [
|
||||
{
|
||||
name: "Suggestion",
|
||||
type: "suggestion",
|
||||
},
|
||||
{
|
||||
name: "All blocks",
|
||||
type: "all_blocks",
|
||||
number: 103,
|
||||
},
|
||||
];
|
||||
|
||||
const subMenuItems = [
|
||||
{
|
||||
name: "Input blocks",
|
||||
type: "input_blocks",
|
||||
number: 12,
|
||||
},
|
||||
{
|
||||
name: "Action blocks",
|
||||
type: "action_blocks",
|
||||
number: 40,
|
||||
},
|
||||
{
|
||||
name: "Output blocks",
|
||||
type: "output_blocks",
|
||||
number: 6,
|
||||
},
|
||||
];
|
||||
|
||||
const bottomMenuItems = [
|
||||
{
|
||||
name: "Integrations",
|
||||
type: "integrations",
|
||||
number: 24,
|
||||
onClick: () => {
|
||||
setIntegration("");
|
||||
setDefaultState("integrations");
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Marketplace Agents",
|
||||
type: "marketplace_agents",
|
||||
number: 103,
|
||||
},
|
||||
{
|
||||
name: "My Agents",
|
||||
type: "my_agents",
|
||||
number: 6,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="space-y-2 p-4">
|
||||
<MenuItem
|
||||
name={"Suggestion"}
|
||||
selected={defaultState == "suggestion"}
|
||||
onClick={() => setDefaultState("suggestion")}
|
||||
/>
|
||||
<MenuItem
|
||||
name={"All blocks"}
|
||||
number={103}
|
||||
selected={defaultState == "all_blocks"}
|
||||
onClick={() => setDefaultState("all_blocks")}
|
||||
/>
|
||||
{topLevelMenuItems.map((item) => (
|
||||
<MenuItem
|
||||
key={item.type}
|
||||
name={item.name}
|
||||
number={item.number}
|
||||
selected={defaultState === item.type}
|
||||
onClick={() => setDefaultState(item.type as DefaultStateType)}
|
||||
/>
|
||||
))}
|
||||
<div className="ml-[0.5365rem] border-l border-black/10 pl-[0.75rem]">
|
||||
<MenuItem
|
||||
name={"Input blocks"}
|
||||
number={12}
|
||||
selected={defaultState == "input_blocks"}
|
||||
onClick={() => setDefaultState("input_blocks")}
|
||||
/>
|
||||
<MenuItem
|
||||
name={"Action blocks"}
|
||||
number={40}
|
||||
selected={defaultState == "action_blocks"}
|
||||
onClick={() => setDefaultState("action_blocks")}
|
||||
/>
|
||||
<MenuItem
|
||||
name={"Output blocks"}
|
||||
number={6}
|
||||
selected={defaultState == "output_blocks"}
|
||||
onClick={() => setDefaultState("output_blocks")}
|
||||
/>
|
||||
{subMenuItems.map((item) => (
|
||||
<MenuItem
|
||||
key={item.type}
|
||||
name={item.name}
|
||||
number={item.number}
|
||||
selected={defaultState === item.type}
|
||||
onClick={() => setDefaultState(item.type as DefaultStateType)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<MenuItem
|
||||
name={"Integrations"}
|
||||
number={24}
|
||||
selected={defaultState == "integrations"}
|
||||
onClick={() => {
|
||||
setIntegration("");
|
||||
setDefaultState("integrations");
|
||||
}}
|
||||
/>
|
||||
<MenuItem
|
||||
name={"Marketplace Agents"}
|
||||
number={103}
|
||||
selected={defaultState == "marketplace_agents"}
|
||||
onClick={() => setDefaultState("marketplace_agents")}
|
||||
/>
|
||||
<MenuItem
|
||||
name={"My Agents"}
|
||||
number={6}
|
||||
selected={defaultState == "my_agents"}
|
||||
onClick={() => setDefaultState("my_agents")}
|
||||
/>
|
||||
{bottomMenuItems.map((item) => (
|
||||
<MenuItem
|
||||
key={item.type}
|
||||
name={item.name}
|
||||
number={item.number}
|
||||
selected={defaultState === item.type}
|
||||
onClick={
|
||||
item.onClick ||
|
||||
(() => setDefaultState(item.type as DefaultStateType))
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ const InputBlocksContent: React.FC = () => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
const fetchBlocks = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
||||
@@ -24,7 +24,7 @@ const IntegrationBlocks: React.FC<IntegrationBlocksProps> = ({
|
||||
const [blocks, setBlocks] = useState<IntegrationBlockData[]>([]);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
if (integration) {
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -19,7 +19,7 @@ const IntegrationList: React.FC<IntegrationListProps> = ({
|
||||
const [integrations, setIntegrations] = useState<IntegrationData[]>([]);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchIntegrations = async () => {
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -14,7 +14,7 @@ const MarketplaceAgentsContent: React.FC = () => {
|
||||
const [agents, setAgents] = useState<MarketplaceAgent[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchAgents = async () => {
|
||||
try {
|
||||
|
||||
@@ -14,7 +14,7 @@ const MyAgentsContent: React.FC = () => {
|
||||
const [agents, setAgents] = useState<UserAgent[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchAgents = async () => {
|
||||
try {
|
||||
|
||||
@@ -7,7 +7,7 @@ const OutputBlocksContent: React.FC = () => {
|
||||
const [blocks, setBlocks] = useState<BlockListType[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchBlocks = async () => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -28,7 +28,7 @@ const SuggestionContent: React.FC<SuggestionContentProps> = ({
|
||||
{ title: string; description: string }[] | null
|
||||
>(null);
|
||||
|
||||
// Update Block Menu fetching
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
|
||||
@@ -42,6 +42,7 @@ const FiltersList = () => {
|
||||
{ key: "templates", name: "Templates" },
|
||||
];
|
||||
|
||||
// TEMPORARY FETCHING
|
||||
useEffect(() => {
|
||||
const mockCreators = ["Abhi", "Abhi 1", "Abhi 2", "Abhi 3", "Abhi 4"];
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ const SearchList = ({ searchQuery }: { searchQuery: string }) => {
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||
|
||||
useEffect(() => {
|
||||
// TEMPORARY FETCHING
|
||||
const fetchData = async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user