mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-12 10:04:45 +08:00
feat: enhance welcome component and input box with skill mode handling and localization updates
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
PlusIcon,
|
||||
ZapIcon,
|
||||
} from "lucide-react";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { useCallback, useMemo, useState, type ComponentProps } from "react";
|
||||
|
||||
import {
|
||||
@@ -96,6 +97,7 @@ export function InputBox({
|
||||
onStop?: () => void;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const searchParams = useSearchParams();
|
||||
const [modelDialogOpen, setModelDialogOpen] = useState(false);
|
||||
const { models } = useModels();
|
||||
const selectedModel = useMemo(() => {
|
||||
@@ -347,7 +349,7 @@ export function InputBox({
|
||||
/>
|
||||
</PromptInputTools>
|
||||
</PromptInputFooter>
|
||||
{isNewThread && (
|
||||
{isNewThread && searchParams.get("mode") !== "skill" && (
|
||||
<div className="absolute right-0 -bottom-12 left-0 z-0 flex items-center justify-center">
|
||||
<SuggestionList />
|
||||
</div>
|
||||
|
||||
@@ -17,16 +17,28 @@ export function Welcome({ className }: { className?: string }) {
|
||||
>
|
||||
<div className="text-2xl font-bold">
|
||||
{searchParams.get("mode") === "skill"
|
||||
? `🚀 ${t.settings.skills.createSkill}`
|
||||
? `✨ ${t.welcome.createYourOwnSkill} ✨`
|
||||
: t.welcome.greeting}
|
||||
</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>
|
||||
{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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user