improvements in dash + chatUI

This commit is contained in:
Dhravya 2024-06-02 12:12:38 -05:00
parent 4478a4e248
commit 5fe0caabf8
11 changed files with 64 additions and 60 deletions

View file

@ -0,0 +1,14 @@
import { chatSearchParamsCache } from "../../helpers/lib/searchParams";
import ChatWindow from "./chatWindow";
function Page({
searchParams,
}: {
searchParams: Record<string, string | string[] | undefined>;
}) {
const { firstTime, q, spaces } = chatSearchParamsCache.parse(searchParams);
return <ChatWindow q={q} spaces={spaces ?? []} />;
}
export default Page;

View file

@ -0,0 +1,27 @@
import React from "react";
import Menu from "../menu";
import Header from "../header";
import QueryInput from "./queryinput";
import { homeSearchParamsCache } from "@/app/helpers/lib/searchParams";
function Page({
searchParams,
}: {
searchParams: Record<string, string | string[] | undefined>;
}) {
// TODO: use this to show a welcome page/modal
const { firstTime } = homeSearchParamsCache.parse(searchParams);
return (
<div className="max-w-3xl flex mx-auto w-full flex-col">
{/* all content goes here */}
{/* <div className="">hi {firstTime ? 'first time' : ''}</div> */}
<div className="w-full h-96">
<QueryInput />
</div>
</div>
);
}
export default Page;

View file

@ -2,10 +2,9 @@
import { ArrowRightIcon } from "@repo/ui/icons";
import Image from "next/image";
import React, { useCallback, useState } from "react";
import React, { useState } from "react";
import Divider from "@repo/ui/shadcn/divider";
import { MultipleSelector, Option } from "@repo/ui/shadcn/combobox";
import { AnimatePresence } from "framer-motion";
import { useRouter } from "next/navigation";
const OPTIONS: Option[] = [

View file

@ -0,0 +1,17 @@
import React from "react";
import Header from "./header";
import Menu from "./menu";
function Layout({ children }: { children: React.ReactNode }) {
return (
<main className="h-screen flex flex-col p-4 relative">
<Header />
<Menu />
{children}
</main>
);
}
export default Layout;

View file

@ -1,6 +1,5 @@
import React from "react";
import Image from "next/image";
import Link from "next/link";
import { MemoriesIcon, ExploreIcon, HistoryIcon } from "@repo/ui/icons";
function Menu() {

View file

@ -0,0 +1,5 @@
{
"scripts": {
"vercel-build": "next build"
}
}

View file

@ -1,24 +0,0 @@
import { chatSearchParamsCache } from "../helpers/lib/searchParams";
import Menu from "../home/menu";
import Header from "../home/header";
import ChatWindow from "./chatWindow";
function Page({
searchParams,
}: {
searchParams: Record<string, string | string[] | undefined>;
}) {
const { firstTime, q, spaces } = chatSearchParamsCache.parse(searchParams);
return (
<main className="h-screen flex flex-col p-4 relative">
<Menu />
<Header />
<ChatWindow q={q} spaces={spaces ?? []} />
</main>
);
}
export default Page;

View file

@ -1,33 +0,0 @@
import React from "react";
import Menu from "./menu";
import Header from "./header";
import QueryInput from "./queryinput";
import { homeSearchParamsCache } from "@/app/helpers/lib/searchParams";
function Page({
searchParams,
}: {
searchParams: Record<string, string | string[] | undefined>;
}) {
// TODO: use this to show a welcome page/modal
const { firstTime } = homeSearchParamsCache.parse(searchParams);
return (
<main className="h-screen flex flex-col p-4 relative">
<Menu />
<Header />
<div className="max-w-3xl flex mx-auto w-full flex-col">
{/* all content goes here */}
{/* <div className="">hi {firstTime ? 'first time' : ''}</div> */}
<div className="w-full h-96">
<QueryInput />
</div>
</div>
</main>
);
}
export default Page;