mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 12:22:40 +02:00
feat: add graceful public chat not found page
This commit is contained in:
parent
3cf8647d50
commit
8d9dfc7aa4
4 changed files with 42 additions and 11 deletions
|
|
@ -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 (
|
||||||
|
<main className="min-h-screen bg-linear-to-b from-gray-50 to-gray-100 text-gray-900 dark:from-black dark:to-gray-900 dark:text-white overflow-x-hidden">
|
||||||
|
<Navbar />
|
||||||
|
<div className="flex h-screen flex-col items-center justify-center gap-6 px-4 text-center">
|
||||||
|
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-muted">
|
||||||
|
<Link2Off className="h-8 w-8 text-muted-foreground" />
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col gap-2">
|
||||||
|
<h1 className="text-2xl font-semibold">{t("not_found_title")}</h1>
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
<Link href="/login" className="text-primary underline hover:text-primary/80">
|
||||||
|
{t("click_here")}
|
||||||
|
</Link>{" "}
|
||||||
|
{t("sign_in_prompt")}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import { ScrapeWebpageToolUI } from "@/components/tool-ui/scrape-webpage";
|
||||||
import { usePublicChat } from "@/hooks/use-public-chat";
|
import { usePublicChat } from "@/hooks/use-public-chat";
|
||||||
import { usePublicChatRuntime } from "@/hooks/use-public-chat-runtime";
|
import { usePublicChatRuntime } from "@/hooks/use-public-chat-runtime";
|
||||||
import { PublicChatFooter } from "./public-chat-footer";
|
import { PublicChatFooter } from "./public-chat-footer";
|
||||||
|
import { PublicChatNotFound } from "./public-chat-not-found";
|
||||||
import { PublicThread } from "./public-thread";
|
import { PublicThread } from "./public-thread";
|
||||||
|
|
||||||
interface PublicChatViewProps {
|
interface PublicChatViewProps {
|
||||||
|
|
@ -32,17 +33,7 @@ export function PublicChatView({ shareToken }: PublicChatViewProps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error || !data) {
|
if (error || !data) {
|
||||||
return (
|
return <PublicChatNotFound />;
|
||||||
<main className="min-h-screen bg-linear-to-b from-gray-50 to-gray-100 text-gray-900 dark:from-black dark:to-gray-900 dark:text-white overflow-x-hidden">
|
|
||||||
<Navbar />
|
|
||||||
<div className="flex h-screen flex-col items-center justify-center gap-4 px-4 text-center">
|
|
||||||
<h1 className="text-2xl font-semibold">Chat not found</h1>
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
This chat may have been removed or is no longer public.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -796,5 +796,10 @@
|
||||||
"comments": "comments",
|
"comments": "comments",
|
||||||
"example_comment": "Let's discuss this tomorrow!"
|
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -781,5 +781,10 @@
|
||||||
"comments": "评论",
|
"comments": "评论",
|
||||||
"example_comment": "我们明天讨论这个!"
|
"example_comment": "我们明天讨论这个!"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"public_chat": {
|
||||||
|
"not_found_title": "此对话已被删除。",
|
||||||
|
"click_here": "点击这里",
|
||||||
|
"sign_in_prompt": "登录 SurfSense 开始您自己的对话。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue