-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stability Enhancements and Bug Fixes (#193)
* Stability Enhancements and Bug Fixes * Build fixes * Use react-markdown
- Loading branch information
Showing
29 changed files
with
2,331 additions
and
2,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
NEXT_PUBLIC_API_URL="https://ayushma-api.ohc.network/api/" | ||
NEXT_PUBLIC_COOKIE_STORAGE="ayushma-storage" | ||
NEXT_PUBLIC_AI_NAME="Ayushma" | ||
NEXT_PUBLIC_AI_DESCRIPTION="Revolutionizing medical diagnosis through AI and Opensource" | ||
NEXT_PUBLIC_AI_DESCRIPTION="Ayushma - Revolutionizing Healthcare Delivery Through AI and Open Source" | ||
NEXT_PUBLIC_AI_WARNING="Please be aware that Ayushma AI may generate inaccurate information; kindly report any concerns to [email protected]" | ||
NEXT_PUBLIC_GOOGLE_RECAPTCHA_SITE_KEY="6Lerts4nAAAAAKyXaNZkYj4XfRO0M2R-XYIA3qv8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,47 @@ | ||
import { Project } from "@/types/project"; | ||
import { API } from "@/utils/api"; | ||
import { redirect } from "next/navigation"; | ||
import Client from "./client"; | ||
"use client"; | ||
|
||
const getDefaultProject = async () => { | ||
//const projects = await API.projects.list(); | ||
//return projects.results.find((project: Project) => project.is_default); | ||
} | ||
import { Project } from "@/types/project"; | ||
import { API, paginatedResponse } from "@/utils/api"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { useRouter } from "next/navigation"; | ||
import { useEffect } from "react"; | ||
|
||
export default async function Page() { | ||
let defaultProject; | ||
try { | ||
//defaultProject = await getDefaultProject(); | ||
export default function Page() { | ||
const projectsQuery = useQuery<paginatedResponse<Project>>({ | ||
queryKey: ["projects", "app"], | ||
queryFn: () => | ||
API.projects.list({ | ||
ordering: "-is_default,created_at", | ||
}), | ||
}); | ||
const router = useRouter(); | ||
|
||
} catch (error) { | ||
console.log(error); | ||
} | ||
useEffect(() => { | ||
const defaultProject = projectsQuery.data?.results?.find( | ||
(project: Project) => project.is_default, | ||
); | ||
if (defaultProject) router.push(`/project/${defaultProject.external_id}`); | ||
}, [projectsQuery.data]); | ||
|
||
//if (defaultProject) redirect(`/project/${defaultProject.external_id}`); | ||
return ( | ||
<div className="flex flex-col justify-center items-center h-screen"> | ||
{projectsQuery.isLoading && ( | ||
<div className="flex items-center"> | ||
<div className="w-4 h-4 mr-2 rounded-full bg-gray-900 animate-pulse"></div> | ||
<div className="w-4 h-4 mr-2 rounded-full bg-gray-900 animate-pulse"></div> | ||
<div className="w-4 h-4 rounded-full bg-gray-900 animate-pulse"></div> | ||
</div> | ||
)} | ||
|
||
return <Client /> | ||
{!projectsQuery.isLoading && | ||
!projectsQuery.data?.results?.find( | ||
(project: Project) => project.is_default, | ||
) && ( | ||
<div className="flex flex-col justify-center items-center"> | ||
<i className="fa-regular fa-folder-open text-4xl"></i> | ||
<div className="mt-5 font-semibold">No default project found</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.