Skip to content

Commit

Permalink
feat: add delete and add data source
Browse files Browse the repository at this point in the history
  • Loading branch information
ervinpiol committed Oct 11, 2024
1 parent 966d5fe commit fbd3a5a
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 181 deletions.
8 changes: 4 additions & 4 deletions web/src/app/ee/admin/teams/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export const Main = ({ assistants }: { assistants: Assistant[] }) => {
error: documentSetsError,
} = useDocumentSets();

if (isLoading || isDocumentSetsLoading || userIsLoading || isCCPairsLoading) {
return <ThreeDotsLoader />;
}

if (error || !data) {
return <div className="text-red-600">Error loading teams</div>;
}
Expand All @@ -53,10 +57,6 @@ export const Main = ({ assistants }: { assistants: Assistant[] }) => {
return <div className="text-red-600">Error loading teams</div>;
}

if (isLoading || isDocumentSetsLoading || userIsLoading || isCCPairsLoading) {
return <ThreeDotsLoader />;
}

if (ccPairsError || !ccPairs) {
return <div className="text-red-600">Error loading connectors</div>;
}
Expand Down
35 changes: 20 additions & 15 deletions web/src/app/ee/admin/teams/TeamspaceAssistant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,26 @@ export const TeamspaceAssistant = ({
<Pencil size={16} />
</Button>
</div>
<div className="pt-8 flex flex-wrap -space-x-3 pointer-events-none">
{currentAssistants.slice(0, 8).map((assistant) => (
<div
key={assistant.id}
className="bg-primary w-10 h-10 rounded-full flex items-center justify-center font-semibold text-inverted text-lg uppercase"
>
{assistant.name!.charAt(0)}
</div>
))}
{currentAssistants.length > 8 && (
<div className="bg-background w-10 h-10 rounded-full flex items-center justify-center text-sm font-semibold">
+{currentAssistants.length - 8}
</div>
)}
</div>

{teamspace.assistants.length > 0 ? (
<div className="pt-8 flex flex-wrap -space-x-3 pointer-events-none">
{currentAssistants.slice(0, 8).map((assistant) => (
<div
key={assistant.id}
className="bg-primary w-10 h-10 rounded-full flex items-center justify-center font-semibold text-inverted text-lg uppercase"
>
{assistant.name!.charAt(0)}
</div>
))}
{currentAssistants.length > 8 && (
<div className="bg-background w-10 h-10 rounded-full flex items-center justify-center text-sm font-semibold">
+{currentAssistants.length - 8}
</div>
)}
</div>
) : (
<p>There are no assistant.</p>
)}
</div>
}
title="Assistants"
Expand Down
Loading

0 comments on commit fbd3a5a

Please sign in to comment.