mirror of https://github.com/kortix-ai/suna.git
fix import errors
This commit is contained in:
parent
388391c7d8
commit
43f71e1b09
|
@ -20,7 +20,7 @@ import { useCreateAgentWorkflow, useUpdateAgentWorkflow, useAgentWorkflows } fro
|
|||
import { CreateWorkflowRequest, UpdateWorkflowRequest } from '@/hooks/react-query/agents/workflow-utils';
|
||||
import { useAgentTools } from '@/hooks/react-query/agents/use-agent-tools';
|
||||
import { ConditionalWorkflowBuilder, ConditionalStep } from '@/components/agents/workflows/conditional-workflow-builder';
|
||||
import { WorkflowBuilder } from '@/components/workflows/react-flow/workflow-builder';
|
||||
import { WorkflowBuilder } from '@/components/workflows/ui/workflow-builder';
|
||||
|
||||
const convertToNestedJSON = (steps: ConditionalStep[]): any[] => {
|
||||
let globalOrder = 1;
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
import React from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { getCategoryEmoji, getAppCategoryCount } from '../utils';
|
||||
import type { CategorySidebarProps } from '../types';
|
||||
|
||||
export const CategorySidebar: React.FC<CategorySidebarProps> = ({
|
||||
isCollapsed,
|
||||
onToggle,
|
||||
categories,
|
||||
selectedCategory,
|
||||
onCategorySelect,
|
||||
allApps
|
||||
}) => {
|
||||
return (
|
||||
<div className="border-r bg-sidebar flex-shrink-0 sticky top-0 h-[calc(100vh-12vh)] overflow-hidden">
|
||||
<div className="p-3 border-b flex-shrink-0">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<div className={cn(
|
||||
"overflow-hidden transition-all duration-300 ease-in-out",
|
||||
isCollapsed ? "w-0 opacity-0" : "w-auto opacity-100"
|
||||
)}>
|
||||
<h3 className="font-semibold text-sm whitespace-nowrap">Categories</h3>
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={onToggle}
|
||||
className="h-7 w-7"
|
||||
>
|
||||
<ChevronRight className={cn(
|
||||
"h-3 w-3 transition-transform duration-300 ease-in-out",
|
||||
isCollapsed ? "rotate-0" : "rotate-180"
|
||||
)} />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-2 space-y-0.5 flex-1 overflow-y-auto">
|
||||
{categories.map((category) => {
|
||||
const isActive = selectedCategory === category;
|
||||
const emoji = getCategoryEmoji(category);
|
||||
return (
|
||||
<button
|
||||
key={category}
|
||||
onClick={() => onCategorySelect(category)}
|
||||
className={cn(
|
||||
"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-all duration-200 overflow-hidden",
|
||||
isActive
|
||||
? "bg-primary/10 text-primary"
|
||||
: "hover:bg-primary/5"
|
||||
)}
|
||||
title={isCollapsed ? category : undefined}
|
||||
>
|
||||
<span className="text-sm flex-shrink-0">{emoji}</span>
|
||||
<div className={cn(
|
||||
"flex items-center justify-between flex-1 min-w-0 overflow-hidden transition-all duration-300 ease-in-out",
|
||||
isCollapsed ? "w-0 opacity-0" : "w-auto opacity-100"
|
||||
)}>
|
||||
<span className="text-sm truncate whitespace-nowrap">{category}</span>
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -1,65 +0,0 @@
|
|||
import React from 'react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { User } from 'lucide-react';
|
||||
import type { ConnectedAppsSectionProps } from '../types';
|
||||
import { AppCard } from './app-card';
|
||||
|
||||
|
||||
export const ConnectedAppsSection: React.FC<ConnectedAppsSectionProps> = ({
|
||||
connectedApps,
|
||||
showAgentSelector,
|
||||
currentAgentId,
|
||||
agent,
|
||||
agentPipedreamProfiles = [],
|
||||
mode = 'full',
|
||||
onAppSelected,
|
||||
onConnectApp,
|
||||
onConfigureTools,
|
||||
onCategorySelect
|
||||
}) => {
|
||||
const getSectionTitle = () => {
|
||||
if (showAgentSelector && currentAgentId && agent) {
|
||||
return 'Available Connections';
|
||||
}
|
||||
return mode === 'profile-only' ? 'Connected Accounts' : 'My Connections';
|
||||
};
|
||||
|
||||
const getUsedProfilesCount = () => {
|
||||
return agentPipedreamProfiles.length;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mb-6">
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
<User className="h-4 w-4 text-green-600 dark:text-green-400" />
|
||||
<h2 className="text-md font-semibold text-gray-900 dark:text-white">
|
||||
{getSectionTitle()}
|
||||
</h2>
|
||||
<Badge variant="secondary" className="bg-green-50 text-green-700 border-green-200 dark:border-green-900 dark:bg-green-900/20 dark:text-green-400 text-xs">
|
||||
{connectedApps.length} connected
|
||||
</Badge>
|
||||
{showAgentSelector && currentAgentId && getUsedProfilesCount() > 0 && (
|
||||
<Badge variant="secondary" className="bg-primary/10 text-primary border-primary/20 text-xs">
|
||||
{getUsedProfilesCount()} in use
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
||||
{connectedApps.map((app) => (
|
||||
<AppCard
|
||||
key={`${app.name_slug}-${currentAgentId || 'default'}`}
|
||||
app={app}
|
||||
mode={mode}
|
||||
currentAgentId={currentAgentId}
|
||||
agentName={agent?.name}
|
||||
agentPipedreamProfiles={agentPipedreamProfiles}
|
||||
onAppSelected={onAppSelected}
|
||||
onConnectApp={onConnectApp}
|
||||
onConfigureTools={onConfigureTools}
|
||||
handleCategorySelect={onCategorySelect}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -1,7 +1,5 @@
|
|||
export { AppCard } from './app-card';
|
||||
export { CategorySidebar } from './category-sidebar';
|
||||
export { PipedreamHeader } from './pipedream-header';
|
||||
export { ConnectedAppsSection } from './connected-apps-section';
|
||||
export { AppsGrid } from './apps-grid';
|
||||
export { EmptyState } from './empty-state';
|
||||
export { PaginationControls } from './pagination-controls';
|
Loading…
Reference in New Issue