From 5f7d3bb285f2cf0dc57394901b61dc27360d040d Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 22 Aug 2026 23:10:36 +0000 Subject: [PATCH] Terminal --- src/routes/_authenticated/students.index.tsx | 59 -------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/routes/_authenticated/students.index.tsx diff --git a/src/routes/_authenticated/students.index.tsx b/src/routes/_authenticated/students.index.tsx deleted file mode 100644 index 6a54276..0000000 --- a/src/routes/_authenticated/students.index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { createFileRoute, Link } from "@tanstack/react-router"; -import { useQuery } from "@tanstack/react-query"; -import { supabase } from "@/integrations/supabase/client"; -import { useAuth } from "@/hooks/use-auth"; -import { Button } from "@/components/ui/button"; -import { Plus, ChevronRight } from "lucide-react"; - -export const Route = createFileRoute("/_authenticated/students/")({ - head: () => ({ meta: [{ title: "Students — School Portal" }] }), - component: StudentsIndexPage, -}); - -function StudentsIndexPage() { - const { roles } = useAuth(); - const isAdmin = roles.includes("admin"); - - const { data: students } = useQuery({ - queryKey: ["students"], - queryFn: async () => { - const { data, error } = await supabase - .from("students") - .select("id, first_name, last_name, dob, allergies, photo_release, class_id, classes(name)") - .order("last_name"); - if (error) throw error; - return data ?? []; - }, - }); - - return ( -
-
-
-

Students

-

{students?.length ?? 0} students visible to you

-
- {isAdmin && ( - - - - )} -
- -
- {(students ?? []).map((s) => ( - -
-
{s.last_name}, {s.first_name}
-
- {(s.classes as { name: string } | null)?.name ?? "No class"} · {s.allergies ? `Allergies: ${s.allergies}` : "No allergies"} -
-
- - - ))} - {students?.length === 0 &&
No students yet.
} -
-
- ); -}