69 lines
2.1 KiB
TypeScript
69 lines
2.1 KiB
TypeScript
"use client";
|
|
|
|
import { useSearchParams } from "next/navigation";
|
|
import { useMemo } from "react";
|
|
|
|
import { useI18n } from "@/core/i18n/hooks";
|
|
import { useDisplayDesensitizer } from "@/core/sensitive-words/use-display-desensitizer";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
import { AuroraText } from "../ui/aurora-text";
|
|
|
|
export function Welcome({
|
|
className,
|
|
mode,
|
|
}: {
|
|
className?: string;
|
|
mode?: "ultra" | "pro" | "thinking" | "flash";
|
|
}) {
|
|
const { t } = useI18n();
|
|
const desensitizeText = useDisplayDesensitizer();
|
|
const searchParams = useSearchParams();
|
|
const isUltra = useMemo(() => mode === "ultra", [mode]);
|
|
const colors = useMemo(() => {
|
|
if (isUltra) {
|
|
return ["#efefbb", "#e9c665", "#e3a812"];
|
|
}
|
|
return ["var(--color-foreground)"];
|
|
}, [isUltra]);
|
|
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-[26px] font-medium tracking-tight text-foreground/85">
|
|
{searchParams.get("mode") === "skill" ? (
|
|
t.welcome.createYourOwnSkill
|
|
) : (
|
|
<div className="flex items-center">
|
|
<AuroraText colors={colors}>{desensitizeText(t.welcome.greeting)}</AuroraText>
|
|
</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="font-sans whitespace-pre">
|
|
{t.welcome.description}
|
|
</pre>
|
|
) : (
|
|
<p>{t.welcome.description}</p>
|
|
)} */}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|