diff --git a/src/routes/_authenticated/classes.$id.tsx b/src/routes/_authenticated/classes.$id.tsx deleted file mode 100644 index 7f20572..0000000 --- a/src/routes/_authenticated/classes.$id.tsx +++ /dev/null @@ -1,46 +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 { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; -import { ArrowLeft, Lock, Loader2 } from "lucide-react"; -import { RosterManager, GradebookGrid, GradingConfigEditor } from "@/components/gradebook"; - -export const Route = createFileRoute("/_authenticated/classes/$id")({ - head: () => ({ meta: [{ title: "Class — School Portal" }] }), - component: ClassDetail, -}); - -function ClassDetail() { - const { id } = Route.useParams(); - const { user, roles } = useAuth(); - const isAdmin = roles.includes("admin"); - - const { data: cls, isLoading } = useQuery({ - queryKey: ["class", id], - queryFn: async () => (await supabase.from("classes").select("*").eq("id", id).single()).data, - }); - const isTeacher = !!cls && cls.teacher_id === user?.id; - const canEdit = isAdmin || isTeacher; - - if (isLoading) return
You don't have access to this class.