diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx
index d075ce0..1219ac7 100644
--- a/src/app/dashboard/page.tsx
+++ b/src/app/dashboard/page.tsx
@@ -11,19 +11,21 @@ const DashboardPage = async () => {
const { data: investigations, error } = await supabase.from("investigations").select("id, title, description")
if (error) return unauthorized()
return (
-
-
-
Vos investigations
-
- La liste de vos investigations. Vous pouvez également en créer d'autres.
-
-
-
-
-
-
-
-
+
+
+
+
Vos investigations
+
+ La liste de vos investigations. Vous pouvez également en créer d'autres.
+
+
+
+
+
+
+ {/*
+
*/}
+
{investigations.map((investigation) => (
diff --git a/src/app/investigations/[investigation_id]/left.tsx b/src/app/investigations/[investigation_id]/left.tsx
index ea8e274..8793614 100644
--- a/src/app/investigations/[investigation_id]/left.tsx
+++ b/src/app/investigations/[investigation_id]/left.tsx
@@ -29,7 +29,7 @@ const Left = ({ investigation_id }: { investigation_id: string }) => {
)
return (
-
+
@@ -92,7 +92,6 @@ const Left = ({ investigation_id }: { investigation_id: string }) => {
-
diff --git a/src/app/investigations/[investigation_id]/loading.tsx b/src/app/investigations/[investigation_id]/loading.tsx
index 48e8ea0..5b483d3 100644
--- a/src/app/investigations/[investigation_id]/loading.tsx
+++ b/src/app/investigations/[investigation_id]/loading.tsx
@@ -1,8 +1,9 @@
+import Loader from '@/components/loader'
import React from 'react'
const loading = () => {
return (
- Loading nodes and edges...
+ Loading nodes and edges...
)
}
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 9096e66..fd022d4 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,12 +1,14 @@
-import { Button } from '@/components/ui/button'
-import Link from "next/link";
+import { createClient } from '@/lib/supabase/server';
+import { redirect } from 'next/navigation';
-export default function Home() {
- return (
-
- );
+export default async function Home() {
+ const supabase = await createClient()
+ const {
+ data: { user },
+ error: userError,
+ } = await supabase.auth.getUser();
+ if (!user || userError) {
+ return redirect("/login")
+ }
+ return redirect("/dashboard")
}
diff --git a/src/components/investigations/graph.tsx b/src/components/investigations/graph.tsx
index 2d05106..0db342e 100644
--- a/src/components/investigations/graph.tsx
+++ b/src/components/investigations/graph.tsx
@@ -28,6 +28,7 @@ import { TooltipTrigger } from '@radix-ui/react-tooltip';
import { cn } from '@/lib/utils';
import { useInvestigationStore } from '@/store/investigation-store';
import { useFlowStore } from '../../store/flow-store';
+import Loader from '../loader';
// import CurrentNode from './current-node-card';
const edgeTypes = {
@@ -206,7 +207,7 @@ export default function Graph({ graphQuery }: { graphQuery: any }) {
if (!mounted || isLoading) {
return (
- Loading...
+ Loading...
);
}
diff --git a/src/components/investigations/layout.tsx b/src/components/investigations/layout.tsx
index 6d04a19..3ced6d1 100644
--- a/src/components/investigations/layout.tsx
+++ b/src/components/investigations/layout.tsx
@@ -30,7 +30,7 @@ const InvestigationLayout = ({
- {panelOpen &&
+ {panelOpen &&
@@ -51,7 +51,7 @@ const InvestigationLayout = ({
}
-
+
diff --git a/src/components/investigations/nodes/individual.tsx b/src/components/investigations/nodes/individual.tsx
index 54173f1..cbd48d3 100644
--- a/src/components/investigations/nodes/individual.tsx
+++ b/src/components/investigations/nodes/individual.tsx
@@ -81,7 +81,7 @@ function Custom(props: any) {
setIndividualId(data.id)}
className={cn(
- "p-1 border border-border hover:border-primary/40 duration-100 rounded-full shadow-none backdrop-blur bg-background/40",
+ "p-1 border border-border hover:border-primary duration-100 rounded-full shadow-none backdrop-blur bg-background/40",
currentNode === data.id && "border-primary",
)}
>
diff --git a/src/components/loader.tsx b/src/components/loader.tsx
new file mode 100644
index 0000000..ae097fd
--- /dev/null
+++ b/src/components/loader.tsx
@@ -0,0 +1,12 @@
+import React from 'react'
+
+const Loader = () => {
+ return (
+
+ )
+}
+
+export default Loader
\ No newline at end of file
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
index 2cd9d30..0988d45 100644
--- a/src/components/ui/button.tsx
+++ b/src/components/ui/button.tsx
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0",
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm cursor-pointer text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 focus-visible:ring-4 focus-visible:outline-1 aria-invalid:focus-visible:ring-0",
{
variants: {
variant: {
@@ -22,8 +22,8 @@ const buttonVariants = cva(
},
size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3",
- sm: "h-8 rounded-md px-3 has-[>svg]:px-2.5",
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
+ sm: "h-8 rounded-sm cursor-pointer px-3 has-[>svg]:px-2.5",
+ lg: "h-10 rounded-sm cursor-pointer px-6 has-[>svg]:px-4",
icon: "size-9",
},
},