From e1d002a4458a285643c209c174d63c3a276e3d59 Mon Sep 17 00:00:00 2001 From: Zewed Date: Sat, 20 Jan 2024 11:19:07 -0800 Subject: [PATCH 1/9] start --- frontend/app/search/page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 9d3ebc4812c2..c398dc84dc35 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -6,6 +6,7 @@ import { QuivrLogo } from "@/lib/assets/QuivrLogo"; import { SearchBar } from "@/lib/components/ui/SearchBar/SearchBar"; import { useMenuContext } from "@/lib/context/MenuProvider/hooks/useMenuContext"; +import { AddBrainModal } from "@/lib/components/AddBrainModal"; import styles from "./page.module.scss"; const Search = (): JSX.Element => { @@ -27,6 +28,7 @@ const Search = (): JSX.Element => { + ); From dbbffc65662d155ef28f16c3e4ad9c86dc07744b Mon Sep 17 00:00:00 2001 From: Zewed Date: Sat, 20 Jan 2024 12:41:43 -0800 Subject: [PATCH 2/9] stash commit --- frontend/app/search/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index c398dc84dc35..8e948d224fcd 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -3,10 +3,10 @@ import { usePathname } from "next/navigation"; import { useEffect } from "react"; import { QuivrLogo } from "@/lib/assets/QuivrLogo"; +import { AddBrainModal } from "@/lib/components/AddBrainModal"; import { SearchBar } from "@/lib/components/ui/SearchBar/SearchBar"; import { useMenuContext } from "@/lib/context/MenuProvider/hooks/useMenuContext"; -import { AddBrainModal } from "@/lib/components/AddBrainModal"; import styles from "./page.module.scss"; const Search = (): JSX.Element => { From b37fb291ef954f5a77048a2e6ba32ad2ce22d6a6 Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 00:01:44 -0800 Subject: [PATCH 3/9] icon works --- .../components/TestimonialCard.tsx | 2 +- .../utils/socialMediaToIcon.tsx | 2 +- .../components/BrainAccess/BrainAccess.tsx | 2 +- .../hooks/useGeneralInformation.ts | 2 +- .../SettingsTab/hooks/useBrainFormState.ts | 2 +- .../hooks/useFeedCardTriggerUtils.ts | 2 +- frontend/app/search/page.tsx | 59 ++++++++++--------- frontend/lib/api/brain/types.ts | 14 ++--- frontend/lib/api/cms/utils/testimonials.ts | 2 +- .../BrainKnowledgeStep/BrainKnowledgeStep.tsx | 4 +- .../hooks/useBrainStatusOptions.ts | 2 +- .../hooks/useKnowledgeSourceLabel.ts | 2 +- .../lib/components/ui/Icon/Icon.module.scss | 42 +++++++++++++ frontend/lib/components/ui/Icon/Icon.tsx | 38 ++++++++++++ .../ui/LoaderIcon/LoaderIcon.module.scss | 23 -------- .../components/ui/LoaderIcon/LoaderIcon.tsx | 13 ++-- .../lib/components/ui/SearchBar/SearchBar.tsx | 3 +- .../ui/TextButton/TextButton.module.scss} | 0 .../components/ui/TextButton/TextButton.tsx | 0 frontend/lib/config/defaultBrainConfig.ts | 2 +- frontend/lib/context/BrainProvider/types.ts | 2 +- frontend/lib/context/ChatProvider/types.ts | 2 +- frontend/lib/helpers/defineMaxTokens.ts | 2 +- frontend/lib/helpers/getAccessibleModels.ts | 2 +- .../lib/helpers/getBrainIconFromBrainType.tsx | 2 +- frontend/lib/helpers/iconList.ts | 9 +++ frontend/lib/types/Colors.ts | 1 + 27 files changed, 154 insertions(+), 82 deletions(-) create mode 100644 frontend/lib/components/ui/Icon/Icon.module.scss create mode 100644 frontend/lib/components/ui/Icon/Icon.tsx rename frontend/lib/{types/index.ts => components/ui/TextButton/TextButton.module.scss} (100%) create mode 100644 frontend/lib/components/ui/TextButton/TextButton.tsx create mode 100644 frontend/lib/helpers/iconList.ts create mode 100644 frontend/lib/types/Colors.ts diff --git a/frontend/app/(home)/components/TestimonialsSection/components/TestimonialCard.tsx b/frontend/app/(home)/components/TestimonialsSection/components/TestimonialCard.tsx index dfa0c14f00ec..c91b0b5ef8df 100644 --- a/frontend/app/(home)/components/TestimonialsSection/components/TestimonialCard.tsx +++ b/frontend/app/(home)/components/TestimonialsSection/components/TestimonialCard.tsx @@ -1,7 +1,7 @@ import Link from "next/link"; import { Avatar } from "@/lib/components/ui/Avatar"; -import { Testimonial } from "@/lib/types/testimonial"; +import { Testimonial } from "@/lib/types/Testimonial"; import { socialMediaToIcon } from "../utils/socialMediaToIcon"; diff --git a/frontend/app/(home)/components/TestimonialsSection/utils/socialMediaToIcon.tsx b/frontend/app/(home)/components/TestimonialsSection/utils/socialMediaToIcon.tsx index 381ded8442c4..c7583838befd 100644 --- a/frontend/app/(home)/components/TestimonialsSection/utils/socialMediaToIcon.tsx +++ b/frontend/app/(home)/components/TestimonialsSection/utils/socialMediaToIcon.tsx @@ -1,7 +1,7 @@ import { AiFillLinkedin } from "react-icons/ai"; import { RiTwitterXFill } from "react-icons/ri"; -import { Testimonial } from "@/lib/types/testimonial"; +import { Testimonial } from "@/lib/types/Testimonial"; export const socialMediaToIcon: Record< Testimonial["socialMedia"], diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/components/BrainAccess/BrainAccess.tsx b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/components/BrainAccess/BrainAccess.tsx index 1b593717f6ab..da8a6814e0ce 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/components/BrainAccess/BrainAccess.tsx +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/components/BrainAccess/BrainAccess.tsx @@ -2,7 +2,7 @@ import { UseFormSetValue } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { LuLock, LuUnlock } from "react-icons/lu"; -import { BrainConfig, BrainStatus } from "@/lib/types/brainConfig"; +import { BrainConfig, BrainStatus } from "@/lib/types/BrainConfig"; import { BrainAccessRadio } from "./components/BrainAccessRadio"; diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/hooks/useGeneralInformation.ts b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/hooks/useGeneralInformation.ts index fa5167b4500c..65620707b1dc 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/hooks/useGeneralInformation.ts +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/hooks/useGeneralInformation.ts @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { BrainType } from "@/lib/types/brainConfig"; +import { BrainType } from "@/lib/types/BrainConfig"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useGeneralInformation = () => { diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useBrainFormState.ts b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useBrainFormState.ts index cda62059b185..840fb277b4bd 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useBrainFormState.ts +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useBrainFormState.ts @@ -6,7 +6,7 @@ import { useFormContext } from "react-hook-form"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { Brain } from "@/lib/context/BrainProvider/types"; import { useUrlBrain } from "@/lib/hooks/useBrainIdFromUrl"; -import { BrainConfig } from "@/lib/types/brainConfig"; +import { BrainConfig } from "@/lib/types/BrainConfig"; import { useBrainFetcher } from "../../../hooks/useBrainFetcher"; diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/FeedCardTrigger/hooks/useFeedCardTriggerUtils.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/FeedCardTrigger/hooks/useFeedCardTriggerUtils.ts index 82d0a129db18..8c6b861956fa 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/FeedCardTrigger/hooks/useFeedCardTriggerUtils.ts +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ActionsModal/components/FeedCardTrigger/hooks/useFeedCardTriggerUtils.ts @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next"; import { IconType } from "react-icons/lib"; import { LuBot, LuFilePlus, LuUnlock } from "react-icons/lu"; -import { BrainType } from "@/lib/types/brainConfig"; +import { BrainType } from "@/lib/types/BrainConfig"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useFeedCardTriggerUtils = () => { diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 140b28187ffd..10d9f04a6d0a 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -13,36 +13,37 @@ import { useChatsList } from "../chat/[chatId]/hooks/useChatsList"; // eslint-disable-next-line import/order import styles from "./page.module.scss"; - const Search = (): JSX.Element => { - const {setIsOpened} = useMenuContext(); - const pathname = usePathname() - const { session } = useSupabase(); - - useEffect(() => { - if (session === null) { - redirectToLogin(); - } - setIsOpened(false) - }, [pathname, session, setIsOpened]); - - useChatsList(); - - return ( -
-
-
- -
- Talk to - Quivr -
-
- - -
-
- ); + const { setIsOpened } = useMenuContext(); + const pathname = usePathname(); + const { session } = useSupabase(); + + useEffect(() => { + if (session === null) { + redirectToLogin(); + } + setIsOpened(false); + }, [pathname, session, setIsOpened]); + + useChatsList(); + + return ( +
+
+
+ +
+ Talk to + Quivr +
+
+ +
+ +
+
+
+ ); }; export default Search; diff --git a/frontend/lib/api/brain/types.ts b/frontend/lib/api/brain/types.ts index eade9e951361..94586b09aa32 100644 --- a/frontend/lib/api/brain/types.ts +++ b/frontend/lib/api/brain/types.ts @@ -1,7 +1,7 @@ import { UUID } from "crypto"; import { BrainRoleType } from "@/lib/components/BrainUsers/types"; -import { BrainStatus, BrainType, Model } from "@/lib/types/brainConfig"; +import { BrainStatus, BrainType, Model } from "@/lib/types/BrainConfig"; export type ApiBrainDefinitionSchemaPropertyType = "string" | "number"; @@ -25,12 +25,12 @@ export type SubscriptionUpdatableProperties = { export type ListFilesProps = { files: { - file_name: string; - file_sha1: string; - file_size: number; - file_url: string; - file_id: string; - file_similarity: number; + file_name: string; + file_sha1: string; + file_size: number; + file_url: string; + file_id: string; + file_similarity: number; }[]; }; diff --git a/frontend/lib/api/cms/utils/testimonials.ts b/frontend/lib/api/cms/utils/testimonials.ts index b1c084ac07ea..0456873b5b60 100644 --- a/frontend/lib/api/cms/utils/testimonials.ts +++ b/frontend/lib/api/cms/utils/testimonials.ts @@ -1,6 +1,6 @@ import { AxiosInstance } from "axios"; -import { Testimonial } from "@/lib/types/testimonial"; +import { Testimonial } from "@/lib/types/Testimonial"; type CmsTestimonials = { data: { diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx index f34d3c73619e..5ff2acce0dd8 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx @@ -4,13 +4,13 @@ import { FaArrowLeft } from "react-icons/fa"; import { ApiRequestDefinition } from "@/lib/components/ApiRequestDefinition"; import Button from "@/lib/components/ui/Button"; -import { BrainType } from "@/lib/types/brainConfig"; +import { BrainType } from "@/lib/types/BrainConfig"; +import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; import { CompositeBrainConnections } from "./components/CompositeBrainConnections/CompositeBrainConnections"; import { KnowledgeToFeedInput } from "./components/KnowledgeToFeedInput"; import { useBrainCreationHandler } from "./hooks/useBrainCreationHandler"; import { useBrainKnowledgeStep } from "./hooks/useBrainKnowledgeStep"; -import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; type BrainKnowledgeStepProps = { onCancelBrainCreation: () => void; diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/hooks/useBrainStatusOptions.ts b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/hooks/useBrainStatusOptions.ts index 039340f3f056..a79478d3e1ed 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/hooks/useBrainStatusOptions.ts +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/hooks/useBrainStatusOptions.ts @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import { BrainStatus } from "@/lib/types/brainConfig"; +import { BrainStatus } from "@/lib/types/BrainConfig"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useBrainStatusOptions = () => { const { t } = useTranslation(["translation", "brain", "config"]); diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/hooks/useKnowledgeSourceLabel.ts b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/hooks/useKnowledgeSourceLabel.ts index 6ece3dcf55e6..0d5e8f05f989 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/hooks/useKnowledgeSourceLabel.ts +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/hooks/useKnowledgeSourceLabel.ts @@ -1,7 +1,7 @@ import { useFeatureIsOn } from "@growthbook/growthbook-react"; import { useTranslation } from "react-i18next"; -import { BrainType } from "@/lib/types/brainConfig"; +import { BrainType } from "@/lib/types/BrainConfig"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useKnowledgeSourceLabel = () => { diff --git a/frontend/lib/components/ui/Icon/Icon.module.scss b/frontend/lib/components/ui/Icon/Icon.module.scss new file mode 100644 index 000000000000..c505140a0fbc --- /dev/null +++ b/frontend/lib/components/ui/Icon/Icon.module.scss @@ -0,0 +1,42 @@ +@use "@/styles/Colors.module.scss"; +@use "@/styles/IconSizes.module.scss"; + +.small { + width: IconSizes.$small; + height: IconSizes.$small; +} + +.normal { + width: IconSizes.$normal; + height: IconSizes.$normal; +} + +.large { + width: IconSizes.$large; + height: IconSizes.$large; +} + +.big { + width: IconSizes.$big; + height: IconSizes.$big; +} + +.black { + color: Colors.$black; +} + +.primary { + color: Colors.$primary; +} + +.accent { + color: Colors.$accent; +} + +.white { + color: Colors.$white; +} + +.disabled { + opacity: 0.2; +} diff --git a/frontend/lib/components/ui/Icon/Icon.tsx b/frontend/lib/components/ui/Icon/Icon.tsx new file mode 100644 index 000000000000..b494963e92cd --- /dev/null +++ b/frontend/lib/components/ui/Icon/Icon.tsx @@ -0,0 +1,38 @@ +import { IconType } from "react-icons/lib"; + +import { iconList } from "@/lib/helpers/iconList"; +import { Color } from "@/lib/types/Colors"; +import { IconSize } from "@/lib/types/Icons"; + +import styles from "./Icon.module.scss"; + +interface IconProps { + name: keyof typeof iconList; + size: IconSize; + color: Color; + disabled?: boolean; + classname?: string; +} + +export const Icon = ({ + name, + size, + color, + disabled, + classname, +}: IconProps): JSX.Element => { + const IconComponent: IconType = iconList[name]; + + return ( + + ); +}; + +export default Icon; diff --git a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.module.scss b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.module.scss index ea786e3fc46d..286aa0afa184 100644 --- a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.module.scss +++ b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.module.scss @@ -3,9 +3,6 @@ .loader_icon { animation: spin 1s linear infinite; - width: IconSizes.$big; - height: IconSizes.$big; - color: Colors.$accent; @keyframes spin { from { @@ -15,24 +12,4 @@ transform: rotate(360deg); } } - - &.small { - width: IconSizes.$small; - height: IconSizes.$small; - } - - &.normal { - width: IconSizes.$normal; - height: IconSizes.$normal; - } - - &.large { - width: IconSizes.$large; - height: IconSizes.$large; - } - - &.big { - width: IconSizes.$big; - height: IconSizes.$big; - } } diff --git a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx index 6cc9b555d7c2..a0a5c7793383 100644 --- a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx +++ b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx @@ -1,17 +1,22 @@ -import { AiOutlineLoading3Quarters } from "react-icons/ai"; - +import { Color } from "@/lib/types/Colors"; import { IconSize } from "@/lib/types/Icons"; +import { Icon } from "../Icon/Icon"; +// eslint-disable-next-line import/order import styles from "./LoaderIcon.module.scss"; interface LoaderIconProps { size: IconSize; + color: Color; } export const LoaderIcon = (props: LoaderIconProps): JSX.Element => { return ( - ); }; diff --git a/frontend/lib/components/ui/SearchBar/SearchBar.tsx b/frontend/lib/components/ui/SearchBar/SearchBar.tsx index a3e56829f0aa..07108b952472 100644 --- a/frontend/lib/components/ui/SearchBar/SearchBar.tsx +++ b/frontend/lib/components/ui/SearchBar/SearchBar.tsx @@ -35,7 +35,6 @@ export const SearchBar = (): JSX.Element => { }; /* eslint-disable @typescript-eslint/restrict-template-expressions */ - return (
{ placeholder="Search" > {searching ? ( - + ) : ( Date: Mon, 22 Jan 2024 14:35:49 -0800 Subject: [PATCH 4/9] eslint rules --- frontend/.eslintrc.js | 4 +++- frontend/app/search/page.tsx | 2 +- .../components/ui/LoaderIcon/LoaderIcon.tsx | 2 +- .../components/ui/TextButton/TextButton.tsx | 23 +++++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 0191a9538879..ab121e55290d 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -41,7 +41,9 @@ module.exports = { ["external", "builtin"], "unknown", "internal", - ["parent", "sibling", "index"], + "parent", + "sibling", + "index", ], alphabetize: { order: "asc", diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 10d9f04a6d0a..79f9e3a2ea29 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -10,7 +10,7 @@ import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; import { useChatsList } from "../chat/[chatId]/hooks/useChatsList"; -// eslint-disable-next-line import/order + import styles from "./page.module.scss"; const Search = (): JSX.Element => { diff --git a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx index a0a5c7793383..dfe71f6c81aa 100644 --- a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx +++ b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx @@ -2,7 +2,7 @@ import { Color } from "@/lib/types/Colors"; import { IconSize } from "@/lib/types/Icons"; import { Icon } from "../Icon/Icon"; -// eslint-disable-next-line import/order + import styles from "./LoaderIcon.module.scss"; interface LoaderIconProps { diff --git a/frontend/lib/components/ui/TextButton/TextButton.tsx b/frontend/lib/components/ui/TextButton/TextButton.tsx index e69de29bb2d1..c1e81eeeac2e 100644 --- a/frontend/lib/components/ui/TextButton/TextButton.tsx +++ b/frontend/lib/components/ui/TextButton/TextButton.tsx @@ -0,0 +1,23 @@ +import { iconList } from "@/lib/helpers/iconList"; +import { Color } from "@/lib/types/Colors"; + +import { Icon } from "../Icon/Icon"; + +import styles from "./TextButton.module.scss"; + +interface TextButtonProps { + name: keyof typeof iconList; + label: string; + color: Color; +} + +export const TextButton = (props: TextButtonProps): JSX.Element => { + return ( +
+ + {props.label} +
+ ); +}; + +export default TextButton; From b2e91d3c5337b0e0c42845b3dc94261c61fb4be0 Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 14:36:00 -0800 Subject: [PATCH 5/9] eslint rules --- frontend/lib/components/ui/SearchBar/SearchBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/components/ui/SearchBar/SearchBar.tsx b/frontend/lib/components/ui/SearchBar/SearchBar.tsx index 07108b952472..d0ccebbccbfb 100644 --- a/frontend/lib/components/ui/SearchBar/SearchBar.tsx +++ b/frontend/lib/components/ui/SearchBar/SearchBar.tsx @@ -8,7 +8,7 @@ import { useChatContext } from "@/lib/context"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { LoaderIcon } from "../LoaderIcon/LoaderIcon"; -// eslint-disable-next-line import/order + import styles from "./SearchBar.module.scss"; export const SearchBar = (): JSX.Element => { From 860d60de48c33a74d812818b4c1b5556e3b0d419 Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 15:54:16 -0800 Subject: [PATCH 6/9] wip --- frontend/app/search/page.module.scss | 77 +++++++++++-------- frontend/app/search/page.tsx | 8 +- .../AddBrainModal/AddBrainModal.tsx | 10 +-- .../AddBrainSteps/AddBrainSteps.tsx | 28 +++---- .../lib/components/ui/Icon/Icon.module.scss | 4 + frontend/lib/components/ui/Icon/Icon.tsx | 3 + .../ui/TextButton/TextButton.module.scss | 18 +++++ .../components/ui/TextButton/TextButton.tsx | 28 ++++++- frontend/styles/_Variables.module.scss | 1 + 9 files changed, 109 insertions(+), 68 deletions(-) create mode 100644 frontend/styles/_Variables.module.scss diff --git a/frontend/app/search/page.module.scss b/frontend/app/search/page.module.scss index 4bd14c48bb60..cdfd2ad99d72 100644 --- a/frontend/app/search/page.module.scss +++ b/frontend/app/search/page.module.scss @@ -1,43 +1,52 @@ -@use '@/styles/Colors.module.scss'; -@use '@/styles/IconSizes.module.scss'; -@use '@/styles/ScreenSizes.module.scss'; -@use '@/styles/Spacings.module.scss'; -@use '@/styles/Typography.module.scss'; +@use "@/styles/Colors.module.scss"; +@use "@/styles/IconSizes.module.scss"; +@use "@/styles/ScreenSizes.module.scss"; +@use "@/styles/Spacings.module.scss"; +@use "@/styles/Typography.module.scss"; +@use "@/styles/Variables.module.scss"; .search_page_container { - background-color: Colors.$ivory; - width: 100%; - height: 100%; - display: flex; - justify-content: center; - align-items: center; + background-color: Colors.$ivory; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; - .main_container { - display: flex; - flex-direction: column; - row-gap: Spacings.$spacing05; - position: relative; - width: 50vw; - margin-inline: auto; + .main_container { + display: flex; + flex-direction: column; + row-gap: Spacings.$spacing05; + position: relative; + width: 50%; + margin-inline: auto; + transform: translateY(-#{Variables.$searchBarHeight}); - @media (max-width: ScreenSizes.$small) { - width: 100%; - margin-inline: Spacings.$spacing07; - } + @media (max-width: ScreenSizes.$small) { + width: 100%; + margin-inline: Spacings.$spacing07; + } - .quivr_logo_wrapper { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; + .quivr_logo_wrapper { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; - .quivr_text { - @include Typography.H1; + .quivr_text { + @include Typography.H1; - .quivr_text_primary { - color: Colors.$primary; - } - } + .quivr_text_primary { + color: Colors.$primary; } + } } -} \ No newline at end of file + } + + .add_brain_wrapper { + position: absolute; + bottom: Spacings.$spacing05; + left: 50%; + transform: translateX(-50%); + } +} diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 79f9e3a2ea29..908ddca7c40a 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -37,11 +37,13 @@ const Search = (): JSX.Element => { Quivr
- -
- +
+
+
+ +
); }; diff --git a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx index 69f2e470f38f..02556dd134f3 100644 --- a/frontend/lib/components/AddBrainModal/AddBrainModal.tsx +++ b/frontend/lib/components/AddBrainModal/AddBrainModal.tsx @@ -6,13 +6,7 @@ import { KnowledgeToFeedProvider } from "@/lib/context"; import { AddBrainSteps } from "./components/AddBrainSteps/AddBrainSteps"; import { CreateBrainProps } from "./types"; -type AddBrainModalProps = { - triggerClassName?: string; -}; - -export const AddBrainModal = ({ - triggerClassName, -}: AddBrainModalProps): JSX.Element => { +export const AddBrainModal = (): JSX.Element => { const defaultValues: CreateBrainProps = { ...addBrainDefaultValues, setDefault: true, @@ -26,7 +20,7 @@ export const AddBrainModal = ({ return ( - + ); diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/AddBrainSteps.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/AddBrainSteps.tsx index 6f10877cc06c..837249366c79 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/AddBrainSteps.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/AddBrainSteps.tsx @@ -1,9 +1,7 @@ import { useTranslation } from "react-i18next"; -import { LuPlusCircle } from "react-icons/lu"; -import Button from "@/lib/components/ui/Button"; import { Modal } from "@/lib/components/ui/Modal"; -import { cn } from "@/lib/utils"; +import TextButton from "@/lib/components/ui/TextButton/TextButton"; import { BrainKnowledgeStep } from "./components/BrainKnowledgeStep/BrainKnowledgeStep"; import { BrainParamsStep } from "./components/BrainParamsStep/BrainParamsStep"; @@ -11,13 +9,7 @@ import { BrainTypeSelectionStep } from "./components/BrainTypeSelectionStep/Brai import { Stepper } from "./components/Stepper/Stepper"; import { useAddBrainConfig } from "./hooks/useAddBrainConfig"; -type AddBrainConfigProps = { - triggerClassName?: string; -}; - -export const AddBrainSteps = ({ - triggerClassName, -}: AddBrainConfigProps): JSX.Element => { +export const AddBrainSteps = (): JSX.Element => { const { t } = useTranslation(["translation", "brain", "config"]); const { isBrainCreationModalOpened, setIsBrainCreationModalOpened } = @@ -26,15 +18,13 @@ export const AddBrainSteps = ({ return ( void 0} - variant={"tertiary"} - className={cn("border-0", triggerClassName)} - data-testid="add-brain-button" - > - - {t("newBrain", { ns: "brain" })} - +
void 0}> + +
} title={t("newBrainTitle", { ns: "brain" })} desc={t("newBrainSubtitle", { ns: "brain" })} diff --git a/frontend/lib/components/ui/Icon/Icon.module.scss b/frontend/lib/components/ui/Icon/Icon.module.scss index c505140a0fbc..43e854d7d36c 100644 --- a/frontend/lib/components/ui/Icon/Icon.module.scss +++ b/frontend/lib/components/ui/Icon/Icon.module.scss @@ -23,6 +23,10 @@ .black { color: Colors.$black; + + &.hovered { + color: Colors.$accent; + } } .primary { diff --git a/frontend/lib/components/ui/Icon/Icon.tsx b/frontend/lib/components/ui/Icon/Icon.tsx index b494963e92cd..e940965728ad 100644 --- a/frontend/lib/components/ui/Icon/Icon.tsx +++ b/frontend/lib/components/ui/Icon/Icon.tsx @@ -12,6 +12,7 @@ interface IconProps { color: Color; disabled?: boolean; classname?: string; + hovered?: boolean; } export const Icon = ({ @@ -20,6 +21,7 @@ export const Icon = ({ color, disabled, classname, + hovered, }: IconProps): JSX.Element => { const IconComponent: IconType = iconList[name]; @@ -30,6 +32,7 @@ export const Icon = ({ ${styles[size] ?? ""} ${styles[color] ?? ""} ${disabled ? styles.disabled ?? "" : ""} + ${hovered ? styles.hovered ?? "" : ""} `} /> ); diff --git a/frontend/lib/components/ui/TextButton/TextButton.module.scss b/frontend/lib/components/ui/TextButton/TextButton.module.scss index e69de29bb2d1..158a18935f43 100644 --- a/frontend/lib/components/ui/TextButton/TextButton.module.scss +++ b/frontend/lib/components/ui/TextButton/TextButton.module.scss @@ -0,0 +1,18 @@ +@use "@/styles/Colors.module.scss"; +@use "@/styles/Spacings.module.scss"; + +.text_button_wrapper { + display: flex; + align-items: center; + gap: Spacings.$spacing03; + cursor: pointer; + background-color: transparent; +} + +.black { + color: Colors.$black; + + &.hovered { + color: Colors.$accent; + } +} diff --git a/frontend/lib/components/ui/TextButton/TextButton.tsx b/frontend/lib/components/ui/TextButton/TextButton.tsx index c1e81eeeac2e..6e9d363fc7f2 100644 --- a/frontend/lib/components/ui/TextButton/TextButton.tsx +++ b/frontend/lib/components/ui/TextButton/TextButton.tsx @@ -1,3 +1,5 @@ +import { useState } from "react"; + import { iconList } from "@/lib/helpers/iconList"; import { Color } from "@/lib/types/Colors"; @@ -6,16 +8,34 @@ import { Icon } from "../Icon/Icon"; import styles from "./TextButton.module.scss"; interface TextButtonProps { - name: keyof typeof iconList; + iconName: keyof typeof iconList; label: string; color: Color; } export const TextButton = (props: TextButtonProps): JSX.Element => { + const [hovered, setHovered] = useState(false); + return ( -
- - {props.label} +
setHovered(true)} + onMouseLeave={() => setHovered(false)} + > + + {props.label} + +
); }; diff --git a/frontend/styles/_Variables.module.scss b/frontend/styles/_Variables.module.scss new file mode 100644 index 000000000000..a638dc3ecb56 --- /dev/null +++ b/frontend/styles/_Variables.module.scss @@ -0,0 +1 @@ +$searchBarHeight: 62px; From c1c7f355a98b99b471e98860616845f5cb25982c Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 16:08:46 -0800 Subject: [PATCH 7/9] wip --- frontend/app/brains-management/page.tsx | 6 +++--- .../Editor/components/MentionsList/MentionsList.tsx | 2 +- frontend/lib/components/ui/TextButton/TextButton.tsx | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/app/brains-management/page.tsx b/frontend/app/brains-management/page.tsx index 54758e3e3589..9d2604104049 100644 --- a/frontend/app/brains-management/page.tsx +++ b/frontend/app/brains-management/page.tsx @@ -11,8 +11,8 @@ const BrainsManagement = (): JSX.Element => { const { t } = useTranslation("chat"); return ( -
-
+
+
@@ -24,7 +24,7 @@ const BrainsManagement = (): JSX.Element => {
- +
); diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/MentionsList.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/MentionsList.tsx index 341b114426c5..d341356108f8 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/MentionsList.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/MentionsList.tsx @@ -40,7 +40,7 @@ export const MentionList = forwardRef( /> ))}
-
+
{shouldShowScrollToBottomIcon && ( { onMouseEnter={() => setHovered(true)} onMouseLeave={() => setHovered(false)} > + { > {props.label} -
); }; From 91561e766e8e707bb2f15db753c27c5bc7471261 Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 16:18:41 -0800 Subject: [PATCH 8/9] resolve bug --- .../components/Editor/hooks/useChatStateUpdater.ts | 4 +--- frontend/lib/components/ui/SearchBar/SearchBar.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useChatStateUpdater.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useChatStateUpdater.ts index 78413a3422e0..ae5fc2ee82a2 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useChatStateUpdater.ts +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useChatStateUpdater.ts @@ -28,9 +28,7 @@ export const useChatStateUpdater = ({ const { text, brainId, promptId } = getChatInputAttributesFromEditorState(editorNewState); - if (text !== "") { - setMessage(text); - } + setMessage(text); if (brainId !== currentBrainId) { if (brainId === "") { diff --git a/frontend/lib/components/ui/SearchBar/SearchBar.tsx b/frontend/lib/components/ui/SearchBar/SearchBar.tsx index eab3e97ee148..067a76a9517f 100644 --- a/frontend/lib/components/ui/SearchBar/SearchBar.tsx +++ b/frontend/lib/components/ui/SearchBar/SearchBar.tsx @@ -13,6 +13,7 @@ import styles from "./SearchBar.module.scss"; export const SearchBar = (): JSX.Element => { const [searching, setSearching] = useState(false); + const [isDisabled, setIsDisabled] = useState(true); const { message, setMessage } = useChatInput(); const { setMessages } = useChatContext(); const { addQuestion } = useChat(); @@ -20,7 +21,8 @@ export const SearchBar = (): JSX.Element => { useEffect(() => { setCurrentBrainId(null); - }, [setCurrentBrainId]); + setIsDisabled(message === ""); + }, [setCurrentBrainId, message]); const submit = async (): Promise => { setSearching(true); @@ -47,7 +49,10 @@ export const SearchBar = (): JSX.Element => { ) : ( void submit()} /> )} From 4a0b97b5224f76ca3dacb758bbbf9c9174013f4c Mon Sep 17 00:00:00 2001 From: Zewed Date: Mon, 22 Jan 2024 17:15:07 -0800 Subject: [PATCH 9/9] big lint changes --- frontend/.eslintrc.js | 2 +- frontend/app/(auth)/login/components/EmailLogin/index.tsx | 1 + frontend/app/(home)/components/UseCases/UseCases.tsx | 1 + .../components/AddKnowledge/hooks/useAddKnowledge.ts | 1 + .../components/AddedKnowledge/AddedKnowledge.tsx | 1 + .../components/KnowledgeOrSecretsTab/index.tsx | 1 + .../components/GeneralInformation/GeneralInformation.tsx | 1 + .../components/SettingsTab/hooks/useSettingsTab.ts | 1 + .../brains-management/components/BrainsTabs/BrainsTabs.tsx | 1 + .../MentionsList/components/MentionItem/MentionItem.tsx | 1 + .../ChatEditor/components/Editor/hooks/useBrainMention.ts | 1 + .../components/Editor/hooks/usePromptSuggestionsConfig.ts | 1 + .../components/OnboardingQuestion/OnboardingQuestion.tsx | 1 + .../ChatDialogue/components/Onboarding/Onboarding.tsx | 1 + .../ChatDialogueArea/components/ChatDialogue/index.tsx | 1 + frontend/app/chat/[chatId]/hooks/useChat.ts | 1 + frontend/app/chat/[chatId]/hooks/useQuestion.ts | 1 + frontend/app/contact/page.tsx | 1 + frontend/app/search/page.tsx | 3 ++- frontend/e2e/tests/chat/chat.ts | 1 + frontend/e2e/tests/chat/utils/testSelectBrain.ts | 1 + frontend/e2e/tests/chat/utils/testUnplugChat.ts | 1 + .../components/BrainKnowledgeStep/BrainKnowledgeStep.tsx | 3 ++- .../components/BrainParamsStep/BrainParamsStep.tsx | 1 + .../BrainTypeSelectionStep/BrainTypeSelectionStep.tsx | 1 + .../components/AddBrainSteps/components/Stepper/Stepper.tsx | 1 + .../ApiBrainSecretsInputs/ApiBrainSecretsInputs.tsx | 1 + .../components/ParamsDefinition/ParamsDefinition.tsx | 1 + .../components/ParamsDefinition/hooks/useParamsDefinition.ts | 1 + .../components/SecretsDefinition/SecretsDefinition.tsx | 1 + .../SecretsDefinition/hooks/useSecretsDefinition.ts | 1 + .../components/BrainUsers/components/BrainUser/BrainUser.tsx | 2 ++ frontend/lib/components/ChatHistory/ChatHistory.tsx | 1 + .../components/FeedItems/components/CrawlFeedItem.tsx | 1 + .../components/FeedItems/components/FileFeedItem.tsx | 1 + .../lib/components/Stripe/PricingModal/StripePricingModal.tsx | 1 + frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx | 4 ++-- frontend/lib/components/ui/SearchBar/SearchBar.tsx | 4 ++-- frontend/lib/components/ui/TextButton/TextButton.tsx | 4 ++-- frontend/lib/context/BrainProvider/types.ts | 3 ++- frontend/lib/helpers/getFileIcon.tsx | 1 + frontend/lib/hooks/useDropzone.ts | 1 + 42 files changed, 49 insertions(+), 10 deletions(-) diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index ab121e55290d..4d52897a69ef 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -41,8 +41,8 @@ module.exports = { ["external", "builtin"], "unknown", "internal", - "parent", "sibling", + "parent", "index", ], alphabetize: { diff --git a/frontend/app/(auth)/login/components/EmailLogin/index.tsx b/frontend/app/(auth)/login/components/EmailLogin/index.tsx index 83b4ef2f5488..30264d20ff8e 100644 --- a/frontend/app/(auth)/login/components/EmailLogin/index.tsx +++ b/frontend/app/(auth)/login/components/EmailLogin/index.tsx @@ -9,6 +9,7 @@ import { useAuthModes } from "@/lib/hooks/useAuthModes"; import { EmailInput } from "./components/EmailInput"; import { MagicLinkLogin } from "./components/MagicLinkLogin/MaginLinkLogin"; import { PasswordLogin } from "./components/PasswordLogin/PasswordLogin"; + import { EmailAuthContextType } from "../../types"; export const EmailLogin = (): JSX.Element => { diff --git a/frontend/app/(home)/components/UseCases/UseCases.tsx b/frontend/app/(home)/components/UseCases/UseCases.tsx index 53245dcb5cb8..d107fbde5862 100644 --- a/frontend/app/(home)/components/UseCases/UseCases.tsx +++ b/frontend/app/(home)/components/UseCases/UseCases.tsx @@ -5,6 +5,7 @@ import { LuChevronRight } from "react-icons/lu"; import Button from "@/lib/components/ui/Button"; import { UseCasesListing } from "./components/UseCasesListing/UseCasesListing"; + import { useHomepageTracking } from "../../hooks/useHomepageTracking"; export const UseCases = (): JSX.Element => { diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddKnowledge/hooks/useAddKnowledge.ts b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddKnowledge/hooks/useAddKnowledge.ts index 230499f80dc3..6a3e69d6f2ec 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddKnowledge/hooks/useAddKnowledge.ts +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddKnowledge/hooks/useAddKnowledge.ts @@ -3,6 +3,7 @@ import { useEffect } from "react"; import { useUrlBrain } from "@/lib/hooks/useBrainIdFromUrl"; import { useFeedBrain } from "./useFeedBrain"; + import { useKnowledge } from "../../../hooks/useKnowledge"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddedKnowledge/AddedKnowledge.tsx b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddedKnowledge/AddedKnowledge.tsx index b7b15c9a6dd5..4c5c8d4c93c6 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddedKnowledge/AddedKnowledge.tsx +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddedKnowledge/AddedKnowledge.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import Spinner from "@/lib/components/ui/Spinner"; import { useAddedKnowledge } from "./hooks/useAddedKnowledge"; + import { KnowledgeTable } from "../KnowledgeTable/KnowledgeTable"; type AddedKnowledgeProps = { diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/index.tsx b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/index.tsx index 6dbbadeccbde..6876bc5fc7ec 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/index.tsx +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/index.tsx @@ -8,6 +8,7 @@ import { KnowledgeToFeedProvider } from "@/lib/context"; import { AddKnowledge } from "./components/AddKnowledge/AddKnowledge"; import { AddedKnowledge } from "./components/AddedKnowledge/AddedKnowledge"; + import { useBrainFetcher } from "../../hooks/useBrainFetcher"; import { NoAccess } from "../NoAccess"; diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/GeneralInformation.tsx b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/GeneralInformation.tsx index 14ce85a06d52..99c55e8e0843 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/GeneralInformation.tsx +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/components/GeneralInformation/GeneralInformation.tsx @@ -12,6 +12,7 @@ import { TextArea } from "@/lib/components/ui/TextArea"; import { BrainAccess } from "./components/BrainAccess/BrainAccess"; import { useGeneralInformation } from "./hooks/useGeneralInformation"; + import { useBrainFormState } from "../../hooks/useBrainFormState"; type GeneralInformationProps = { diff --git a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts index fec6475cc643..24661823ee31 100644 --- a/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts +++ b/frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/SettingsTab/hooks/useSettingsTab.ts @@ -12,6 +12,7 @@ import { useToast } from "@/lib/hooks"; import { useUserData } from "@/lib/hooks/useUserData"; import { useBrainFormState } from "./useBrainFormState"; + import { isBrainDescriptionValid } from "../utils/isBrainDescriptionValid"; import { isBrainNameValid } from "../utils/isBrainNameValid"; diff --git a/frontend/app/brains-management/components/BrainsTabs/BrainsTabs.tsx b/frontend/app/brains-management/components/BrainsTabs/BrainsTabs.tsx index c7b24417f2d2..a046ba00b96a 100644 --- a/frontend/app/brains-management/components/BrainsTabs/BrainsTabs.tsx +++ b/frontend/app/brains-management/components/BrainsTabs/BrainsTabs.tsx @@ -6,6 +6,7 @@ import { Tabs, TabsContent, TabsList } from "@/lib/components/ui/Tabs"; import { BrainSearchBar } from "./components/BrainSearchBar"; import { BrainsList } from "./components/BrainsList"; import { useBrainsTabs } from "./hooks/useBrainsTabs"; + import { StyledTabsTrigger } from "../StyledTabsTrigger"; export const BrainsTabs = (): JSX.Element => { diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/components/MentionItem/MentionItem.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/components/MentionItem/MentionItem.tsx index f29ce50025e6..716ee42fbbaa 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/components/MentionItem/MentionItem.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/components/MentionsList/components/MentionItem/MentionItem.tsx @@ -1,6 +1,7 @@ import { cn } from "@/lib/utils"; import { useMentionItemIcon } from "./hooks/useMentionItemIcon"; + import { SuggestionDataType, SuggestionItem } from "../../../../types"; type MentionItemProps = { diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useBrainMention.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useBrainMention.ts index 73647ad99ed1..a5f7f8956091 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useBrainMention.ts +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/useBrainMention.ts @@ -1,6 +1,7 @@ import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { useMentionConfig } from "./useMentionConfig"; + import { SuggestionItem } from "../types"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/usePromptSuggestionsConfig.ts b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/usePromptSuggestionsConfig.ts index ae4fd8bd804b..adb1751e8fdd 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/usePromptSuggestionsConfig.ts +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/ChatEditor/components/Editor/hooks/usePromptSuggestionsConfig.ts @@ -1,6 +1,7 @@ import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; import { useMentionConfig } from "./useMentionConfig"; + import { SuggestionItem } from "../types"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/OnboardingQuestions/components/OnboardingQuestion/OnboardingQuestion.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/OnboardingQuestions/components/OnboardingQuestion/OnboardingQuestion.tsx index dea668270409..9b5034488693 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/OnboardingQuestions/components/OnboardingQuestion/OnboardingQuestion.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/ChatInput/components/OnboardingQuestions/components/OnboardingQuestion/OnboardingQuestion.tsx @@ -3,6 +3,7 @@ import { Fragment } from "react"; import { useOnboarding } from "@/lib/hooks/useOnboarding"; import { useOnboardingQuestion } from "./hooks/useOnboardingQuestion"; + import { QuestionId } from "../../types"; type OnboardingQuestionsProps = { diff --git a/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/components/Onboarding/Onboarding.tsx b/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/components/Onboarding/Onboarding.tsx index 4ce2697163ef..da6743a97e00 100644 --- a/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/components/Onboarding/Onboarding.tsx +++ b/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/components/Onboarding/Onboarding.tsx @@ -7,6 +7,7 @@ import { useOnboardingTracker } from "@/lib/hooks/useOnboardingTracker"; import { useStreamText } from "@/lib/hooks/useStreamText"; import { stepsContainerStyle } from "./styles"; + import { MessageRow } from "../QADisplay"; export const Onboarding = (): JSX.Element => { diff --git a/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/index.tsx b/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/index.tsx index 50d7105e2718..18274e179ce8 100644 --- a/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/index.tsx +++ b/frontend/app/chat/[chatId]/components/ChatDialogueArea/components/ChatDialogue/index.tsx @@ -10,6 +10,7 @@ import { chatItemContainerClassName, } from "./styles"; import { getKeyFromChatItem } from "./utils/getKeyFromChatItem"; + import { ChatItemWithGroupedNotifications } from "../../types"; type MessagesDialogueProps = { diff --git a/frontend/app/chat/[chatId]/hooks/useChat.ts b/frontend/app/chat/[chatId]/hooks/useChat.ts index 8b37dd75f42d..f5c21e96d64c 100644 --- a/frontend/app/chat/[chatId]/hooks/useChat.ts +++ b/frontend/app/chat/[chatId]/hooks/useChat.ts @@ -17,6 +17,7 @@ import { useEventTracking } from "@/services/analytics/june/useEventTracking"; import { useLocalStorageChatConfig } from "./useLocalStorageChatConfig"; import { useQuestion } from "./useQuestion"; + import { ChatQuestion } from "../types"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/frontend/app/chat/[chatId]/hooks/useQuestion.ts b/frontend/app/chat/[chatId]/hooks/useQuestion.ts index 0fdd3b220d3b..2c3474e874b5 100644 --- a/frontend/app/chat/[chatId]/hooks/useQuestion.ts +++ b/frontend/app/chat/[chatId]/hooks/useQuestion.ts @@ -5,6 +5,7 @@ import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainConte import { useFetch, useToast } from "@/lib/hooks"; import { useHandleStream } from "./useHandleStream"; + import { ChatQuestion } from "../types"; import { generatePlaceHolderMessage } from "../utils/generatePlaceHolderMessage"; diff --git a/frontend/app/contact/page.tsx b/frontend/app/contact/page.tsx index 7808c03172e2..2bd296fd9f0c 100644 --- a/frontend/app/contact/page.tsx +++ b/frontend/app/contact/page.tsx @@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next"; import Card from "@/lib/components/ui/Card"; import { ContactForm } from "./components"; + import { FooterSection, HomeHeader, diff --git a/frontend/app/search/page.tsx b/frontend/app/search/page.tsx index 908ddca7c40a..5246dc43bde8 100644 --- a/frontend/app/search/page.tsx +++ b/frontend/app/search/page.tsx @@ -9,9 +9,10 @@ import { useMenuContext } from "@/lib/context/MenuProvider/hooks/useMenuContext" import { useSupabase } from "@/lib/context/SupabaseProvider"; import { redirectToLogin } from "@/lib/router/redirectToLogin"; +import styles from "./page.module.scss"; + import { useChatsList } from "../chat/[chatId]/hooks/useChatsList"; -import styles from "./page.module.scss"; const Search = (): JSX.Element => { const { setIsOpened } = useMenuContext(); diff --git a/frontend/e2e/tests/chat/chat.ts b/frontend/e2e/tests/chat/chat.ts index a8dac07e2a86..c0ce0cb68fc8 100644 --- a/frontend/e2e/tests/chat/chat.ts +++ b/frontend/e2e/tests/chat/chat.ts @@ -4,6 +4,7 @@ import { testChat } from "./utils/testChat"; import { testDeleteChats } from "./utils/testDeleteChats"; import { testSelectBrain } from "./utils/testSelectBrain"; import { testUnplugChat } from "./utils/testUnplugChat"; + import { login } from "../../utils/login"; export const chatTests = (): void => { diff --git a/frontend/e2e/tests/chat/utils/testSelectBrain.ts b/frontend/e2e/tests/chat/utils/testSelectBrain.ts index b35c0503ba11..92b723f46b8f 100644 --- a/frontend/e2e/tests/chat/utils/testSelectBrain.ts +++ b/frontend/e2e/tests/chat/utils/testSelectBrain.ts @@ -1,4 +1,5 @@ import { Page } from "@playwright/test"; + import { getEditor } from "./getEditor"; export const testSelectBrain = async (page: Page): Promise => { diff --git a/frontend/e2e/tests/chat/utils/testUnplugChat.ts b/frontend/e2e/tests/chat/utils/testUnplugChat.ts index bfbac929f5d6..1c816a217fe8 100644 --- a/frontend/e2e/tests/chat/utils/testUnplugChat.ts +++ b/frontend/e2e/tests/chat/utils/testUnplugChat.ts @@ -1,4 +1,5 @@ import { Page } from "@playwright/test"; + import { getEditor } from "./getEditor"; export const testUnplugChat = async (page: Page): Promise => { diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx index 5ff2acce0dd8..3ab1c161aa0f 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/BrainKnowledgeStep.tsx @@ -6,12 +6,13 @@ import { ApiRequestDefinition } from "@/lib/components/ApiRequestDefinition"; import Button from "@/lib/components/ui/Button"; import { BrainType } from "@/lib/types/BrainConfig"; -import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; import { CompositeBrainConnections } from "./components/CompositeBrainConnections/CompositeBrainConnections"; import { KnowledgeToFeedInput } from "./components/KnowledgeToFeedInput"; import { useBrainCreationHandler } from "./hooks/useBrainCreationHandler"; import { useBrainKnowledgeStep } from "./hooks/useBrainKnowledgeStep"; +import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; + type BrainKnowledgeStepProps = { onCancelBrainCreation: () => void; }; diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/BrainParamsStep.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/BrainParamsStep.tsx index 956b10efd0bc..a86d4a5aaa4e 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/BrainParamsStep.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainParamsStep/BrainParamsStep.tsx @@ -11,6 +11,7 @@ import { PublicAccessConfirmationModal } from "./components/PublicAccessConfirma import { useBrainParamsStep } from "./hooks/useBrainParamsStep"; import { useBrainStatusOptions } from "./hooks/useBrainStatusOptions"; import { usePublicAccessConfirmationModal } from "./hooks/usePublicAccessConfirmationModal"; + import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; import { useBrainTypeSelectionStep } from "../BrainTypeSelectionStep/hooks/useBrainTypeSelectionStep"; diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/BrainTypeSelectionStep.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/BrainTypeSelectionStep.tsx index 9f02f5eb5a02..dd261d27e3fb 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/BrainTypeSelectionStep.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainTypeSelectionStep/BrainTypeSelectionStep.tsx @@ -7,6 +7,7 @@ import { Radio } from "@/lib/components/ui/Radio"; import { useBrainTypeSelectionStep } from "./hooks/useBrainTypeSelectionStep"; import { useKnowledgeSourceLabel } from "./hooks/useKnowledgeSourceLabel"; + import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; type BrainTypeSelectionStepProps = { diff --git a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/Stepper/Stepper.tsx b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/Stepper/Stepper.tsx index 2d54aede87cf..021cb63edbf2 100644 --- a/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/Stepper/Stepper.tsx +++ b/frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/Stepper/Stepper.tsx @@ -3,6 +3,7 @@ import { Fragment } from "react"; import { cn } from "@/lib/utils"; import { Step } from "./components/Step"; + import { useBrainCreationSteps } from "../../hooks/useBrainCreationSteps"; export const Stepper = (): JSX.Element => { diff --git a/frontend/lib/components/ApiBrainSecretsInputs/ApiBrainSecretsInputs.tsx b/frontend/lib/components/ApiBrainSecretsInputs/ApiBrainSecretsInputs.tsx index 085038a8bd56..b9b6198cc4ff 100644 --- a/frontend/lib/components/ApiBrainSecretsInputs/ApiBrainSecretsInputs.tsx +++ b/frontend/lib/components/ApiBrainSecretsInputs/ApiBrainSecretsInputs.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import { useBrainFetcher } from "@/app/brains-management/[brainId]/components/BrainManagementTabs/hooks/useBrainFetcher"; import { useApiBrainSecretsInputs } from "./hooks/useApiBrainSecretsInputs"; + import Button from "../ui/Button"; type ApiBrainSecretsInputsProps = { diff --git a/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/ParamsDefinition.tsx b/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/ParamsDefinition.tsx index 52c746f238ac..d8ac2a9a573e 100644 --- a/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/ParamsDefinition.tsx +++ b/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/ParamsDefinition.tsx @@ -8,6 +8,7 @@ import Button from "@/lib/components/ui/Button"; import { ParamDefinitionRow } from "./components/ParamDefinitionRow"; import { defaultParamDefinitionRow } from "./config"; import { useParamsDefinition } from "./hooks/useParamsDefinition"; + import { tabDescriptionStyle } from "../../styles"; type ParamsDefinitionProps = { diff --git a/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/hooks/useParamsDefinition.ts b/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/hooks/useParamsDefinition.ts index c7c630de18be..075767fdd16a 100644 --- a/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/hooks/useParamsDefinition.ts +++ b/frontend/lib/components/ApiRequestDefinition/components/ParamsDefinition/hooks/useParamsDefinition.ts @@ -2,6 +2,7 @@ import { useEffect } from "react"; import { useForm, useFormContext, useWatch } from "react-hook-form"; import { useParamsDefinitionDefaultValues } from "./useParamsDefinitionDefaultValues"; + import { ApiDefinitionContextType } from "../../../types"; import { ParameterDefinition } from "../types"; import { mapParameterDefinitionToApiBrainDefinitionSchema } from "../utils/mapParameterDefinitionToApiBrainDefinitionSchema"; diff --git a/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/SecretsDefinition.tsx b/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/SecretsDefinition.tsx index adb4cd658b22..f6952f1fd9a5 100644 --- a/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/SecretsDefinition.tsx +++ b/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/SecretsDefinition.tsx @@ -11,6 +11,7 @@ import { defaultSecretDefinitionRow, } from "./config"; import { useSecretsDefinition } from "./hooks/useSecretsDefinition"; + import { tabDescriptionStyle } from "../../styles"; const paramsNameStyle = "flex flex-1 justify-center"; diff --git a/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/hooks/useSecretsDefinition.ts b/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/hooks/useSecretsDefinition.ts index f34bdbb8c7f2..6e0da98d3cff 100644 --- a/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/hooks/useSecretsDefinition.ts +++ b/frontend/lib/components/ApiRequestDefinition/components/SecretsDefinition/hooks/useSecretsDefinition.ts @@ -2,6 +2,7 @@ import { useEffect } from "react"; import { useForm, useFormContext, useWatch } from "react-hook-form"; import { useSecretsDefinitionDefaultValues } from "./useSecretsDefinitionDefaultValues"; + import { ApiDefinitionContextType } from "../../../types"; import { brainSecretsSchemaDefinitionKeyInForm, diff --git a/frontend/lib/components/BrainUsers/components/BrainUser/BrainUser.tsx b/frontend/lib/components/BrainUsers/components/BrainUser/BrainUser.tsx index da8ae522ecd9..86b55f1148e2 100644 --- a/frontend/lib/components/BrainUsers/components/BrainUser/BrainUser.tsx +++ b/frontend/lib/components/BrainUsers/components/BrainUser/BrainUser.tsx @@ -7,7 +7,9 @@ import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainConte import { RemoveAccessIcon } from "./components/RemoveAccessIcon"; import { useBrainUser } from "./hooks/useBrainUser"; + import { BrainRoleType } from "../../types"; + type BrainUserProps = { email: string; role: BrainRoleType; diff --git a/frontend/lib/components/ChatHistory/ChatHistory.tsx b/frontend/lib/components/ChatHistory/ChatHistory.tsx index aaa3011dc71b..41c003dd27ff 100644 --- a/frontend/lib/components/ChatHistory/ChatHistory.tsx +++ b/frontend/lib/components/ChatHistory/ChatHistory.tsx @@ -9,6 +9,7 @@ import { isWithinLast7Days, isYesterday, } from "./utils"; + import Spinner from "../ui/Spinner"; export const ChatHistory = (): JSX.Element => { diff --git a/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/CrawlFeedItem.tsx b/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/CrawlFeedItem.tsx index 7755b0c8807c..4f97f9bd0814 100644 --- a/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/CrawlFeedItem.tsx +++ b/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/CrawlFeedItem.tsx @@ -2,6 +2,7 @@ import { IoMdCloseCircle } from "react-icons/io"; import { MdLink } from "react-icons/md"; import { FeedTitleDisplayer } from "./FeedTitleDisplayer"; + import { StyledFeedItemDiv } from "../styles/StyledFeedItemDiv"; type CrawlFeedItemProps = { diff --git a/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/FileFeedItem.tsx b/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/FileFeedItem.tsx index 01e2b2ba696b..01d9b4c07a4c 100644 --- a/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/FileFeedItem.tsx +++ b/frontend/lib/components/KnowledgeToFeedInput/components/FeedItems/components/FileFeedItem.tsx @@ -3,6 +3,7 @@ import { IoMdCloseCircle } from "react-icons/io"; import { getFileIcon } from "@/lib/helpers/getFileIcon"; import { FeedTitleDisplayer } from "./FeedTitleDisplayer"; + import { StyledFeedItemDiv } from "../styles/StyledFeedItemDiv"; type FileFeedItemProps = { diff --git a/frontend/lib/components/Stripe/PricingModal/StripePricingModal.tsx b/frontend/lib/components/Stripe/PricingModal/StripePricingModal.tsx index 35577c13635b..84930d1f3e6c 100644 --- a/frontend/lib/components/Stripe/PricingModal/StripePricingModal.tsx +++ b/frontend/lib/components/Stripe/PricingModal/StripePricingModal.tsx @@ -1,4 +1,5 @@ import { StripePricingTable } from "./components/PricingTable/PricingTable"; + import { Modal } from "../../ui/ModalPayment"; type StripePricingModalProps = { diff --git a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx index dfe71f6c81aa..69485b5f6d8b 100644 --- a/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx +++ b/frontend/lib/components/ui/LoaderIcon/LoaderIcon.tsx @@ -1,10 +1,10 @@ import { Color } from "@/lib/types/Colors"; import { IconSize } from "@/lib/types/Icons"; -import { Icon } from "../Icon/Icon"; - import styles from "./LoaderIcon.module.scss"; +import { Icon } from "../Icon/Icon"; + interface LoaderIconProps { size: IconSize; color: Color; diff --git a/frontend/lib/components/ui/SearchBar/SearchBar.tsx b/frontend/lib/components/ui/SearchBar/SearchBar.tsx index 067a76a9517f..86368a782832 100644 --- a/frontend/lib/components/ui/SearchBar/SearchBar.tsx +++ b/frontend/lib/components/ui/SearchBar/SearchBar.tsx @@ -7,10 +7,10 @@ import { useChat } from "@/app/chat/[chatId]/hooks/useChat"; import { useChatContext } from "@/lib/context"; import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext"; -import { LoaderIcon } from "../LoaderIcon/LoaderIcon"; - import styles from "./SearchBar.module.scss"; +import { LoaderIcon } from "../LoaderIcon/LoaderIcon"; + export const SearchBar = (): JSX.Element => { const [searching, setSearching] = useState(false); const [isDisabled, setIsDisabled] = useState(true); diff --git a/frontend/lib/components/ui/TextButton/TextButton.tsx b/frontend/lib/components/ui/TextButton/TextButton.tsx index 3ba70e4575f6..b65a4efae351 100644 --- a/frontend/lib/components/ui/TextButton/TextButton.tsx +++ b/frontend/lib/components/ui/TextButton/TextButton.tsx @@ -3,10 +3,10 @@ import { useState } from "react"; import { iconList } from "@/lib/helpers/iconList"; import { Color } from "@/lib/types/Colors"; -import { Icon } from "../Icon/Icon"; - import styles from "./TextButton.module.scss"; +import { Icon } from "../Icon/Icon"; + interface TextButtonProps { iconName: keyof typeof iconList; label: string; diff --git a/frontend/lib/context/BrainProvider/types.ts b/frontend/lib/context/BrainProvider/types.ts index 764905874190..84bd83624ad7 100644 --- a/frontend/lib/context/BrainProvider/types.ts +++ b/frontend/lib/context/BrainProvider/types.ts @@ -4,9 +4,10 @@ import { ApiBrainDefinition } from "@/lib/api/brain/types"; import { BrainRoleType } from "@/lib/components/BrainUsers/types"; import { Document } from "@/lib/types/Document"; -import { BrainType, Model } from "../../types/BrainConfig"; import { useBrainProvider } from "./hooks/useBrainProvider"; +import { BrainType, Model } from "../../types/BrainConfig"; + export type BrainAccessStatus = "private" | "public"; export type Brain = { diff --git a/frontend/lib/helpers/getFileIcon.tsx b/frontend/lib/helpers/getFileIcon.tsx index f41fed89779c..5d0de8b3718c 100644 --- a/frontend/lib/helpers/getFileIcon.tsx +++ b/frontend/lib/helpers/getFileIcon.tsx @@ -17,6 +17,7 @@ import { LiaFileVideo } from "react-icons/lia"; import { IconType } from "react-icons/lib"; import { getFileType } from "./getFileType"; + import { SupportedFileExtensions } from "../types/SupportedFileExtensions"; const fileTypeIcons: Record = { diff --git a/frontend/lib/hooks/useDropzone.ts b/frontend/lib/hooks/useDropzone.ts index 065517fe550b..1265bf80bea0 100644 --- a/frontend/lib/hooks/useDropzone.ts +++ b/frontend/lib/hooks/useDropzone.ts @@ -7,6 +7,7 @@ import { useEventTracking } from "@/services/analytics/june/useEventTracking"; import { useOnboarding } from "./useOnboarding"; import { useOnboardingTracker } from "./useOnboardingTracker"; import { useToast } from "./useToast"; + import { useKnowledgeToFeedContext } from "../context/KnowledgeToFeedProvider/hooks/useKnowledgeToFeedContext"; import { acceptedFormats } from "../helpers/acceptedFormats"; import { cloneFileWithSanitizedName } from "../helpers/cloneFileWithSanitizedName";