Files
wr.do/components/shared/docs-lang.tsx
2025-05-31 11:50:09 +08:00

30 lines
826 B
TypeScript

"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { Separator } from "../ui/separator";
export function DocsLang({ en, zh }: { en: string; zh: string }) {
const pathname = usePathname();
return (
<div className="flex items-center gap-1.5">
{pathname !== en ? (
<Link href={en} className="text-blue-500 hover:underline">
English
</Link>
) : (
<p className="text-muted-foreground">English</p>
)}
<div className="h-[20px] w-px shrink-0 border bg-border text-neutral-400"></div>
{pathname !== zh ? (
<Link href={zh} className="text-blue-500 hover:underline">
</Link>
) : (
<p className="text-muted-foreground"></p>
)}
</div>
);
}