diff --git a/apps/nextjs/app/api/causes/route.ts b/apps/nextjs/app/api/causes/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/conditions.ts b/apps/nextjs/app/api/conditions.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/conditions/route.ts b/apps/nextjs/app/api/conditions/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/treatments.ts b/apps/nextjs/app/api/treatments.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/treatments/route.ts b/apps/nextjs/app/api/treatments/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/user/causes/route.ts b/apps/nextjs/app/api/user/causes/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/user/conditions/route.ts b/apps/nextjs/app/api/user/conditions/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/api/user/treatments/route.ts b/apps/nextjs/app/api/user/treatments/route.ts new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/chat/layout.tsx b/apps/nextjs/app/chat/layout.tsx new file mode 100644 index 000000000..6e4c15f4f --- /dev/null +++ b/apps/nextjs/app/chat/layout.tsx @@ -0,0 +1,34 @@ +import { dashboardLinks } from "@/config/links" +import { getCurrentUser } from "@/lib/session" +import Footer from "@/components/layout/footer" +import Navbar from "@/components/layout/navbar" +import { DashboardNav } from "@/components/pages/dashboard/dashboard-nav" + +interface DashboardLayoutProps { + children: React.ReactNode +} + +export default async function DashboardLayout({ + children, +}: DashboardLayoutProps) { + const user = await getCurrentUser() + + return ( +
+ +
+ +
{children}
+
+
+ ) +} diff --git a/apps/nextjs/app/chat/page.tsx b/apps/nextjs/app/chat/page.tsx new file mode 100644 index 000000000..b8d71ea9e --- /dev/null +++ b/apps/nextjs/app/chat/page.tsx @@ -0,0 +1,38 @@ +import { Metadata } from "next" +import { redirect } from "next/navigation" + +import { authOptions } from "@/lib/auth" +import { getCurrentUser } from "@/lib/session" +import { Shell } from "@/components/layout/shell" +import { DashboardHeader } from "@/components/pages/dashboard/dashboard-header" +import ChatComponent from '@/components/chat-component'; + +export const metadata: Metadata = { + title: "Chat", + description: "Monitor your progress.", +} + +interface DashboardProps { + searchParams: { from: string; to: string } +} + +export default async function Dashboard({ searchParams }: DashboardProps) { + const user = await getCurrentUser() + + if (!user) { + redirect(authOptions?.pages?.signIn || "/signin") + } + + + const layout = "grid grid-cols-1 gap-4 md:grid-cols-2"; + + return ( + + + +
+ +
+
+ ) +} diff --git a/apps/nextjs/app/conditions/report/page.tsx b/apps/nextjs/app/conditions/report/page.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/app/survey/page.tsx b/apps/nextjs/app/survey/page.tsx new file mode 100644 index 000000000..52f237fa9 --- /dev/null +++ b/apps/nextjs/app/survey/page.tsx @@ -0,0 +1,17 @@ +import React from "react" +import dynamic from "next/dynamic" +import styled from "styled-components" +const SurveyComponent = dynamic(() => import("../components/survey"), { + ssr: false, +}) +const Container = styled.div` + margin: 2rem; +` +const Survey = () => { + return ( + + + + ) +} +export default Survey diff --git a/apps/nextjs/app/treatments/report/page.tsx b/apps/nextjs/app/treatments/report/page.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/apps/nextjs/components/chat-component.tsx b/apps/nextjs/components/chat-component.tsx new file mode 100644 index 000000000..0f97e5f2f --- /dev/null +++ b/apps/nextjs/components/chat-component.tsx @@ -0,0 +1,37 @@ +"use client"; +import { FullPageChat } from 'flowise-embed-react'; + +export default function ChatComponent() { + return +} diff --git a/apps/nextjs/components/deep-chat-component.tsx b/apps/nextjs/components/deep-chat-component.tsx new file mode 100644 index 000000000..ffff07a07 --- /dev/null +++ b/apps/nextjs/components/deep-chat-component.tsx @@ -0,0 +1,86 @@ +"use client"; + +// !!Useful links at the bottom!! +// import {DeepChat as DeepChatCore} from 'deep-chat'; <- type +//import styles from './style.module.css'; +import dynamic from 'next/dynamic'; + +export default function DeepChatComponent() { + return + + const initialMessages = [ + { + html: ` +
+ + + +
`, + role: 'ai', + }, + // { role: 'user', text: 'Hey, how are you today?' }, + // { role: 'ai', text: 'I am doing very well!' }, + ]; + + // need to import the component dynamically as it uses the 'window' property + const DeepChat = dynamic( + () => import('deep-chat-react').then((mod) => mod.DeepChat), + { + ssr: false, + } + ); + + // demo/style/textInput are examples of passing an object directly into a property + // initialMessages is an example of passing a state object into the property + return ( + <> +
+

Deep Chat

+ +
+ + ); +} + +// Info to get a reference for the component: +// https://github.com/OvidijusParsiunas/deep-chat/issues/59#issuecomment-1839483469 + +// Info to add types to a component reference: +// https://github.com/OvidijusParsiunas/deep-chat/issues/59#issuecomment-1839487740 diff --git a/apps/nextjs/components/survey/SurveyComponent.tsx b/apps/nextjs/components/survey/SurveyComponent.tsx new file mode 100644 index 000000000..73af1fc22 --- /dev/null +++ b/apps/nextjs/components/survey/SurveyComponent.tsx @@ -0,0 +1,27 @@ +// components/survey/index.tsx +import React from "react" +import * as Survey from "survey-react" // import surveyjs +import { questions } from "./content" // these are the survey questions +import { Container } from "./styles" // your styles here + +// Modern theme +import "survey-react/modern.min.css" +// Default theme +// import 'survey-react/survey.min.css'; + +const SurveyComponent = () => { + // Apply theme + Survey.StylesManager.applyTheme("modern") + + // Create a modal + const survey = new Survey.Model(questions) + + // Render the survey + return ( + + + + ) +} + +export default SurveyComponent \ No newline at end of file