diff --git a/surfsense_web/components/public-chat/public-chat-not-found.tsx b/surfsense_web/components/public-chat/public-chat-not-found.tsx new file mode 100644 index 000000000..8ecff6931 --- /dev/null +++ b/surfsense_web/components/public-chat/public-chat-not-found.tsx @@ -0,0 +1,30 @@ +"use client"; + +import { Link2Off } from "lucide-react"; +import Link from "next/link"; +import { useTranslations } from "next-intl"; +import { Navbar } from "@/components/homepage/navbar"; + +export function PublicChatNotFound() { + const t = useTranslations("public_chat"); + + return ( +
+ +
+
+ +
+
+

{t("not_found_title")}

+

+ + {t("click_here")} + {" "} + {t("sign_in_prompt")} +

+
+
+
+ ); +} diff --git a/surfsense_web/components/public-chat/public-chat-view.tsx b/surfsense_web/components/public-chat/public-chat-view.tsx index 8b21fede1..08a450d06 100644 --- a/surfsense_web/components/public-chat/public-chat-view.tsx +++ b/surfsense_web/components/public-chat/public-chat-view.tsx @@ -10,6 +10,7 @@ import { ScrapeWebpageToolUI } from "@/components/tool-ui/scrape-webpage"; import { usePublicChat } from "@/hooks/use-public-chat"; import { usePublicChatRuntime } from "@/hooks/use-public-chat-runtime"; import { PublicChatFooter } from "./public-chat-footer"; +import { PublicChatNotFound } from "./public-chat-not-found"; import { PublicThread } from "./public-thread"; interface PublicChatViewProps { @@ -32,17 +33,7 @@ export function PublicChatView({ shareToken }: PublicChatViewProps) { } if (error || !data) { - return ( -
- -
-

Chat not found

-

- This chat may have been removed or is no longer public. -

-
-
- ); + return ; } return ( diff --git a/surfsense_web/messages/en.json b/surfsense_web/messages/en.json index 409a6fb6f..75b186420 100644 --- a/surfsense_web/messages/en.json +++ b/surfsense_web/messages/en.json @@ -796,5 +796,10 @@ "comments": "comments", "example_comment": "Let's discuss this tomorrow!" } + }, + "public_chat": { + "not_found_title": "This chat has been deleted.", + "click_here": "Click here", + "sign_in_prompt": "to log in to SurfSense and start your own." } } diff --git a/surfsense_web/messages/zh.json b/surfsense_web/messages/zh.json index 750902915..81121ef3e 100644 --- a/surfsense_web/messages/zh.json +++ b/surfsense_web/messages/zh.json @@ -781,5 +781,10 @@ "comments": "评论", "example_comment": "我们明天讨论这个!" } + }, + "public_chat": { + "not_found_title": "此对话已被删除。", + "click_here": "点击这里", + "sign_in_prompt": "登录 SurfSense 开始您自己的对话。" } }