diff --git a/apps/webapp/src/components/connections/ConnectionTable.tsx b/apps/webapp/src/components/connections/ConnectionTable.tsx
index 745f5031f..d07d66784 100644
--- a/apps/webapp/src/components/connections/ConnectionTable.tsx
+++ b/apps/webapp/src/components/connections/ConnectionTable.tsx
@@ -1,11 +1,11 @@
import { columns } from "./components/columns"
import { DataTable } from "../shared/data-table"
import {
- Card,
- CardContent,
- CardHeader,
- CardTitle,
- } from "@/components/ui/card"
+ Card,
+ CardContent,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card"
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../ui/dialog";
import { Button } from "../ui/button";
import { PlusCircledIcon } from "@radix-ui/react-icons";
@@ -14,18 +14,26 @@ import useConnections from "@/hooks/useConnections";
import { DataTableLoading } from "../shared/data-table-loading";
import { useState } from "react";
import AddConnectionButton from "./components/AddConnectionButton";
+import { Skeleton } from "../ui/skeleton";
export default function ConnectionTable() {
const { data: connections, isLoading, error } = useConnections();
const [isGenerated, setIsGenerated] = useState(false);
- if(isLoading){
+ if (isLoading) {
console.log("loading connections..");
}
- if(error){
+ if (error) {
console.log("error connections..");
}
+ if (!connections) {
+ return
+ Connections not found....
+
+
;
+ }
+ const linkedConnections = (filter: string) => connections.filter((connection) => connection.status == filter);
const ts = connections?.map((connection) => ({
organisation: connection.id_project, // replace with actual mapping
@@ -36,45 +44,45 @@ export default function ConnectionTable() {
date: new Date().toISOString(), // replace with actual mapping
}))
-
+
return (
<>
-
- Linked
-
-
- 0
-
+
+ Linked
+
+
+ {linkedConnections("0").length}
+
-
- Incomplete Link
-
-
- 3
-
+
+ Incomplete Link
+
+
+ {linkedConnections("1").length}
+
-
- Relink Needed
-
-
- 1
-
+
+ Relink Needed
+
+
+ {linkedConnections("2").length}
+
-
-
+
+
{isGenerated ?
:
-
+ :
+
}
- {isLoading && }
+ {isLoading && }
{ts && }
>
diff --git a/apps/webapp/src/components/dashboard/components/user-nav.tsx b/apps/webapp/src/components/dashboard/components/user-nav.tsx
index 11d6d98db..064183730 100644
--- a/apps/webapp/src/components/dashboard/components/user-nav.tsx
+++ b/apps/webapp/src/components/dashboard/components/user-nav.tsx
@@ -13,12 +13,13 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
+import { Skeleton } from "@/components/ui/skeleton";
import useProfile from "@/hooks/useProfile";
import useProfileStore from "@/state/profileStore";
import { useEffect } from "react";
export function UserNav() {
- const {data} = useProfile();
+ const {data, isLoading} = useProfile();
if(!data) {
console.log("loading profiles");
}
@@ -50,10 +51,11 @@ import { useEffect } from "react";
- {profile && profile.first_name}
+ {profile ? profile.first_name : isLoading ? : "No profiles found"}
+
- {profile && profile.email}
+ {profile ? profile.email : isLoading ? : "No mail found"}
diff --git a/apps/webapp/src/components/shared/team-switcher.tsx b/apps/webapp/src/components/shared/team-switcher.tsx
index 8ff0a0c2e..c6292ff9f 100644
--- a/apps/webapp/src/components/shared/team-switcher.tsx
+++ b/apps/webapp/src/components/shared/team-switcher.tsx
@@ -110,10 +110,6 @@ export default function TeamSwitcher({ className }: TeamSwitcherProps) {
setShowNewDialog({open: false})
};
- if(!orgs) {
- return <>DHJSDHJ>
- }
-
return (