diff --git a/front/components/assistant/conversation/LimitReachedPopup.tsx b/front/components/assistant/conversation/LimitReachedPopup.tsx deleted file mode 100644 index e75c0a4f3b92..000000000000 --- a/front/components/assistant/conversation/LimitReachedPopup.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Button, Chip } from "@dust-tt/sparkle"; -import { Transition } from "@headlessui/react"; -import { useRouter } from "next/router"; - -export function LimitReachedPopup({ - planLimitReached, - workspaceId, -}: { - planLimitReached: boolean; - workspaceId: string; -}) { - const router = useRouter(); - return ( - -
- Free plan -
-
- Looks like you've used up all your messages. Take a peek at our plans. -
-
-
-
- ); -} diff --git a/front/package-lock.json b/front/package-lock.json index dda233f63db1..d20206a3f92d 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@dust-tt/sparkle": "^0.2.29", + "@dust-tt/sparkle": "^0.2.31", "@emoji-mart/data": "^1.1.2", "@emoji-mart/react": "^1.1.1", "@headlessui/react": "^1.7.7", @@ -860,9 +860,9 @@ "integrity": "sha512-smLocSfrt3s53H/XSVP3/1kP42oqvrkjUPtyaFd1F79ux24oE31BKt+q0c6lsa6hOYrFzsIwyc5GXAI5JmfOew==" }, "node_modules/@dust-tt/sparkle": { - "version": "0.2.29", - "resolved": "https://registry.npmjs.org/@dust-tt/sparkle/-/sparkle-0.2.29.tgz", - "integrity": "sha512-zc5Apcwip4x6GjEeQbDP5IBqsdE3OyltRA+6XGIve3UzJQtiNwAda62a4G3ifAmhY9mcgt4IbU8z0VSeCEqlMQ==", + "version": "0.2.31", + "resolved": "https://registry.npmjs.org/@dust-tt/sparkle/-/sparkle-0.2.31.tgz", + "integrity": "sha512-LpytLXZcfKX1hg1s8IfYZ21hfnVJHbpSHCE6Q0IEpSZWYv5MWFWhhKE7dZDtuaAAUOwMbR4RuRftEiMo9kF+Ng==", "dependencies": { "@headlessui/react": "^1.7.17" }, diff --git a/front/package.json b/front/package.json index d6da4da91740..c7e20c55ba61 100644 --- a/front/package.json +++ b/front/package.json @@ -13,7 +13,7 @@ "initdb": "env $(cat .env.local) npx tsx admin/db.ts" }, "dependencies": { - "@dust-tt/sparkle": "^0.2.29", + "@dust-tt/sparkle": "^0.2.31", "@emoji-mart/data": "^1.1.2", "@emoji-mart/react": "^1.1.1", "@headlessui/react": "^1.7.7", diff --git a/front/pages/w/[wId]/assistant/[cId]/index.tsx b/front/pages/w/[wId]/assistant/[cId]/index.tsx index 09420971cb86..b6938097b8c2 100644 --- a/front/pages/w/[wId]/assistant/[cId]/index.tsx +++ b/front/pages/w/[wId]/assistant/[cId]/index.tsx @@ -6,12 +6,12 @@ import Conversation from "@app/components/assistant/conversation/Conversation"; import { ConversationTitle } from "@app/components/assistant/conversation/ConversationTitle"; import { GenerationContextProvider } from "@app/components/assistant/conversation/GenerationContextProvider"; import { FixedAssistantInputBar } from "@app/components/assistant/conversation/InputBar"; -import { LimitReachedPopup } from "@app/components/assistant/conversation/LimitReachedPopup"; import { AssistantSidebarMenu } from "@app/components/assistant/conversation/SidebarMenu"; import AppLayout from "@app/components/sparkle/AppLayout"; import { SendNotificationsContext } from "@app/components/sparkle/Notification"; import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth"; import { useConversation } from "@app/lib/swr"; +import { LimitReachedPopup } from "@app/pages/w/[wId]/assistant/new"; import { AgentMention, MentionType } from "@app/types/assistant/conversation"; import { UserType, WorkspaceType } from "@app/types/user"; diff --git a/front/pages/w/[wId]/assistant/new.tsx b/front/pages/w/[wId]/assistant/new.tsx index 976c86012f7a..a4157889bf73 100644 --- a/front/pages/w/[wId]/assistant/new.tsx +++ b/front/pages/w/[wId]/assistant/new.tsx @@ -7,6 +7,7 @@ import { ChevronUpIcon, Page, PlusIcon, + Popup, WrenchIcon, } from "@dust-tt/sparkle"; import * as t from "io-ts"; @@ -20,7 +21,6 @@ import { FixedAssistantInputBar, InputBarContext, } from "@app/components/assistant/conversation/InputBar"; -import { LimitReachedPopup } from "@app/components/assistant/conversation/LimitReachedPopup"; import { AssistantSidebarMenu } from "@app/components/assistant/conversation/SidebarMenu"; import AppLayout from "@app/components/sparkle/AppLayout"; import { SendNotificationsContext } from "@app/components/sparkle/Notification"; @@ -424,3 +424,25 @@ const AvatarListItem = function ({ ); }; + +export function LimitReachedPopup({ + planLimitReached, + workspaceId, +}: { + planLimitReached: boolean; + workspaceId: string; +}) { + const router = useRouter(); + return ( + { + void router.push(`/w/${workspaceId}/subscription`); + }} + className="fixed bottom-16 right-16" + /> + ); +} diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx index d92b1255fe09..847f420bc964 100644 --- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx +++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx @@ -9,6 +9,7 @@ import { Page, PencilSquareIcon, PlusIcon, + Popup, SectionHeader, SlackLogo, SliderToggle, @@ -147,6 +148,7 @@ function StandardDataSourceView({ const { documents, total, isDocumentsLoading, isDocumentsError } = useDocuments(owner, dataSource, limit, offset); + const [showDocumentsLimitPopup, setShowDocumentsLimitPopup] = useState(false); const [displayNameByDocId, setDisplayNameByDocId] = useState< Record @@ -240,7 +242,21 @@ function StandardDataSourceView({ {readOnly ? null : (
-
+
+ { + void router.push(`/w/${owner.sId}/subscription`); + }} + onClose={() => { + setShowDocumentsLimitPopup(false); + }} + className="absolute bottom-8 right-0" + /> +
-
- -
-
- - - )} - - ); - } else { - return ( -