mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-05 23:36:37 +08:00
feat: add internationalization support with next-intl
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Mail } from "lucide-react"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useTranslations, useLocale } from "next-intl"
|
||||
import { SignButton } from "../auth/sign-button"
|
||||
|
||||
interface ActionButtonProps {
|
||||
@@ -11,16 +12,18 @@ interface ActionButtonProps {
|
||||
|
||||
export function ActionButton({ isLoggedIn }: ActionButtonProps) {
|
||||
const router = useRouter()
|
||||
const locale = useLocale()
|
||||
const t = useTranslations("home")
|
||||
|
||||
if (isLoggedIn) {
|
||||
return (
|
||||
<Button
|
||||
size="lg"
|
||||
onClick={() => router.push("/moe")}
|
||||
onClick={() => router.push(`/${locale}/moe`)}
|
||||
className="gap-2 bg-primary hover:bg-primary/90 text-white px-8"
|
||||
>
|
||||
<Mail className="w-5 h-5" />
|
||||
进入邮箱
|
||||
{t("actions.enterMailbox")}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user