"use client"; import Link from "next/link"; import { Suspense } from "react"; import { useTranslation } from "react-i18next"; import { BrainRoleType } from "@/lib/components/NavBar/components/NavItems/components/BrainsDropDown/components/BrainActions/types"; import Button from "@/lib/components/ui/Button"; import { Divider } from "@/lib/components/ui/Divider"; import PageHeading from "@/lib/components/ui/PageHeading"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; import { Crawler } from "./components/Crawler"; import { FileUploader } from "./components/FileUploader"; const requiredRolesForUpload: BrainRoleType[] = ["Editor", "Owner"]; const UploadPage = (): JSX.Element => { const { currentBrain } = useBrainContext(); const { session } = useSupabase(); const { t } = useTranslation(["translation", "upload"]); if (session === null) { redirectToLogin(); } if (currentBrain === undefined) { return (