mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import { useSearchParams } from "next/navigation";
|
|
import { useEffect } from "react";
|
|
|
|
import { useI18n } from "@/core/i18n/hooks";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
let waved = false;
|
|
|
|
export function Welcome({ className }: { className?: string }) {
|
|
const { t } = useI18n();
|
|
const searchParams = useSearchParams();
|
|
useEffect(() => {
|
|
waved = true;
|
|
}, []);
|
|
return (
|
|
<div
|
|
className={cn(
|
|
"mx-auto flex w-full flex-col items-center justify-center gap-2 px-8 py-4 text-center",
|
|
className,
|
|
)}
|
|
>
|
|
<div className="text-2xl font-bold">
|
|
{searchParams.get("mode") === "skill" ? (
|
|
`✨ ${t.welcome.createYourOwnSkill} ✨`
|
|
) : (
|
|
<div className="flex items-center gap-2">
|
|
<div className={cn("inline-block", !waved ? "animate-wave" : "")}>
|
|
👋
|
|
</div>
|
|
<div>{t.welcome.greeting}</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
{searchParams.get("mode") === "skill" ? (
|
|
<div className="text-muted-foreground text-sm">
|
|
{t.welcome.createYourOwnSkillDescription.includes("\n") ? (
|
|
<pre className="font-sans whitespace-pre">
|
|
{t.welcome.createYourOwnSkillDescription}
|
|
</pre>
|
|
) : (
|
|
<p>{t.welcome.createYourOwnSkillDescription}</p>
|
|
)}
|
|
</div>
|
|
) : (
|
|
<div className="text-muted-foreground text-sm">
|
|
{t.welcome.description.includes("\n") ? (
|
|
<pre className="whitespace-pre">{t.welcome.description}</pre>
|
|
) : (
|
|
<p>{t.welcome.description}</p>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|