diff --git a/apps/web/app/(dash)/chat/chatWindow.tsx b/apps/web/app/(dash)/chat/chatWindow.tsx
index 3bc9fec6..066e7d20 100644
--- a/apps/web/app/(dash)/chat/chatWindow.tsx
+++ b/apps/web/app/(dash)/chat/chatWindow.tsx
@@ -2,7 +2,7 @@
import { AnimatePresence } from "framer-motion";
import React, { useEffect, useRef, useState } from "react";
-import QueryInput from "../home/queryinput";
+import QueryInput from "./queryinput";
import { cn } from "@repo/ui/lib/utils";
import { motion } from "framer-motion";
import { useRouter } from "next/navigation";
diff --git a/apps/web/app/(dash)/chat/queryinput.tsx b/apps/web/app/(dash)/chat/queryinput.tsx
new file mode 100644
index 00000000..99f55986
--- /dev/null
+++ b/apps/web/app/(dash)/chat/queryinput.tsx
@@ -0,0 +1,83 @@
+"use client";
+
+import { ArrowRightIcon } from "@repo/ui/icons";
+import Image from "next/image";
+import React, { useState } from "react";
+
+function QueryInput({
+ initialSpaces,
+ initialQuery = "",
+ disabled = false,
+ className,
+ mini = false,
+ handleSubmit,
+}: {
+ initialQuery?: string;
+ initialSpaces?: {
+ id: number;
+ name: string;
+ }[];
+ disabled?: boolean;
+ className?: string;
+ mini?: boolean;
+ handleSubmit: (q: string, spaces: { id: number; name: string }[]) => void;
+}) {
+ const [q, setQ] = useState(initialQuery);
+
+ const [selectedSpaces, setSelectedSpaces] = useState<
+ { id: number; name: string }[]
+ >([]);
+
+ return (
+
+
+ {/* input and action button */}
+ {" "}
+
+ {/* selected sources */}
+
+ );
+}
+
+export default QueryInput;
diff --git a/apps/web/app/(dash)/home/filterSpaces.tsx b/apps/web/app/(dash)/home/filterSpaces.tsx
index 6a8ad9ec..c7d1e2eb 100644
--- a/apps/web/app/(dash)/home/filterSpaces.tsx
+++ b/apps/web/app/(dash)/home/filterSpaces.tsx
@@ -1,4 +1,5 @@
import { ChevronUpDownIcon } from "@heroicons/react/24/outline";
+import { ArrowRightIcon } from "@repo/ui/icons";
import {
Command,
CommandGroup,
@@ -7,6 +8,7 @@ import {
CommandList,
} from "@repo/ui/shadcn/command";
import { Check } from "lucide-react";
+import Image from "next/image";
import React, { useState } from "react";
type space = {
@@ -17,11 +19,11 @@ type space = {
export function FilterSpaces({
initialSpaces,
selectedSpaces,
- setSelectedSpaces
+ setSelectedSpaces,
}: {
initialSpaces: space[];
selectedSpaces: space[];
- setSelectedSpaces: React.Dispatch>
+ setSelectedSpaces: React.Dispatch>;
}) {
const [input, setInput] = useState("");
@@ -35,55 +37,71 @@ export function FilterSpaces({
setSelectedSpaces((current) =>
current.some((space) => space.id === selectedSpace.id)
? current.filter((space) => space.id !== selectedSpace.id)
- : [...current, selectedSpace]
+ : [...current, selectedSpace],
);
};
return (
-
-
- {selectedSpaces.map((v) => (
-
- ))}
-
-
-
-
setInput(e.currentTarget.value)}
- value={input}
- />
-
+
+
+
+ {selectedSpaces.map((v) => (
+
+ ))}
-
-
- {initialSpaces.map((space) => (
- handleSelect(space)}
- >
- v.id === space.id) ? "opacity-100" : "opacity-0"}`}
- />
- {space.name}
-
- ))}
-
-
-
+
+
+ setInput(e.currentTarget.value)}
+ value={input}
+ />
+
+
+
+
+ {initialSpaces.map((space) => (
+ handleSelect(space)}
+ >
+ v.id === space.id) ? "opacity-100" : "opacity-0"}`}
+ />
+ {space.name}
+
+ ))}
+
+
+
+
+ {/*
*/}
+
);
}
diff --git a/apps/web/app/(dash)/home/heading.tsx b/apps/web/app/(dash)/home/heading.tsx
index 1a120684..b61ac00b 100644
--- a/apps/web/app/(dash)/home/heading.tsx
+++ b/apps/web/app/(dash)/home/heading.tsx
@@ -1,48 +1,30 @@
import { useEffect, useState } from "react";
-import { headings } from "./headingVariants";
-import { motion } from "framer-motion";
+import { motion } from "framer-motion";
-const slap = {
- initial: {
- opacity: 0,
- scale: 1.1,
- },
- whileInView: { opacity: 1, scale: 1 },
- transition: {
- duration: 0.5,
- ease: "easeInOut",
- },
- viewport: { once: true },
-};
+const headings = [
+ "Unlock your digital brain",
+ "Save everything.",
+ " Connect anything.",
+ "Turn your bookmarks into insights.",
+ "The smart way to use your digital treasure.",
+];
-export function Heading() {
+export function Heading({ query = "" }: { query?: string }) {
const [showHeading, setShowHeading] = useState(0);
- useEffect(()=> {
+ useEffect(() => {
setShowHeading(Math.floor(Math.random() * headings.length));
- })
+ });
return (
-
- {headings[showHeading]!.map((v, i) => {
- return (
-
- {v.content}
-
- );
- })}
-
+
+
+ {headings[showHeading]}
+
+
);
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/(dash)/home/headingVariants.ts b/apps/web/app/(dash)/home/headingVariants.ts
deleted file mode 100644
index 578b87c4..00000000
--- a/apps/web/app/(dash)/home/headingVariants.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-export const headings = [
- [
- {
- type: "text",
- content: "Unlock your",
- },
- {
- type: "highlighted",
- content: " digital brain",
- },
- ],
- [
- {
- type: "text",
- content: "Save",
- },
- {
- type: "highlighted",
- content: " everything.",
- },
- {
- type: "text",
- content: " Connect",
- },
- {
- type: "highlighted",
- content: " anything.",
- },
- ],
- [
- {
- type: "text",
- content: "Turn your bookmarks into",
- },
- {
- type: "highlighted",
- content: " insights.",
- },
- ],
- [
- {
- type: "text",
- content: "The smart way to use your",
- },
- {
- type: "highlighted",
- content: " digital treasure.",
- },
- ],
-];
diff --git a/apps/web/app/(dash)/home/queryinput.tsx b/apps/web/app/(dash)/home/queryinput.tsx
index 225b5039..91f79e5f 100644
--- a/apps/web/app/(dash)/home/queryinput.tsx
+++ b/apps/web/app/(dash)/home/queryinput.tsx
@@ -1,30 +1,22 @@
"use client";
-import { ArrowRightIcon } from "@repo/ui/icons";
-import Image from "next/image";
import React, { useState } from "react";
-import Divider from "@repo/ui/shadcn/divider";
import { FilterSpaces } from "./filterSpaces";
function QueryInput({
initialSpaces,
- initialQuery = "",
- disabled = false,
className,
- mini = false,
handleSubmit,
}: {
- initialQuery?: string;
initialSpaces?: {
id: number;
name: string;
}[];
- disabled?: boolean;
className?: string;
mini?: boolean;
handleSubmit: (q: string, spaces: { id: number; name: string }[]) => void;
}) {
- const [q, setQ] = useState(initialQuery);
+ const [q, setQ] = useState("");
const [selectedSpaces, setSelectedSpaces] = useState<
{ id: number; name: string }[]
@@ -33,7 +25,7 @@ function QueryInput({
return (
{/* input and action button */}
{" "}
- {!mini && (
- <>
-
-
- >
- )}
+
+
- {/* selected sources */}
);
}
diff --git a/packages/ui/icons/arrowright.svg b/packages/ui/icons/arrowright.svg
index 2263251c..13d24bf5 100644
--- a/packages/ui/icons/arrowright.svg
+++ b/packages/ui/icons/arrowright.svg
@@ -1 +1,3 @@
-
\ No newline at end of file
+
diff --git a/packages/ui/shadcn/command.tsx b/packages/ui/shadcn/command.tsx
index 94c4434f..9b95f4c7 100644
--- a/packages/ui/shadcn/command.tsx
+++ b/packages/ui/shadcn/command.tsx
@@ -38,7 +38,7 @@ const CommandInput = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className , ...props }, ref) => (
-
+
;
-}
-
-export default Divider;