"use client"; import { saveApplicationData, saveTags } from "./projectService"; import { uploadFiles } from "./fileUploadService"; import { displayAlert } from "./displayAlert"; import ProjectForm from "./ProjectForm"; import { LegacyLoader } from "@/components/loading/LegacyLoader"; import toast from "react-hot-toast"; import { useRouter } from "next/navigation"; import { useUserRole } from "@/hooks/useUserRole"; export default function ApplyProject() { const router = useRouter(); const { data, session, isLoading, error } = useUserRole(); const role: string = data?.role; if (isLoading || !session) { return ; } const userId = session!.user.id; if (error) { throw error; } if (role != "business") { router.push("/business/apply"); toast.error("Please apply to raise on B2DVentures first!"); return; } const sendApplication = async (data: any) => { try { const { projectId, error } = await saveApplicationData(data, userId); if (error) { displayAlert(error); return; } await saveTags(data["tag"], projectId); await uploadFiles(data["projectPhotos"], `${userId}/${projectId}/photos/`); displayAlert(null); router.push("/"); } catch (error) { displayAlert(error); } }; return (

Apply to raise on B2DVentures

Begin Your First Fundraising Project. Starting a fundraising project is mandatory for all businesses.

This step is crucial to begin your journey and unlock the necessary tools for raising funds.

); }