mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-08 16:56:37 +08:00
feat(sharing): add email and message sharing functionality
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { getTranslations } from "next-intl/server"
|
||||
import { getSharedMessage } from "@/lib/shared-data"
|
||||
import { SharedErrorPage } from "@/components/emails/shared-error-page"
|
||||
import { SharedMessagePageClient } from "./page-client"
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{
|
||||
token: string
|
||||
locale: string
|
||||
}>
|
||||
}
|
||||
|
||||
export default async function SharedMessagePage({ params }: PageProps) {
|
||||
const { token } = await params
|
||||
const tShared = await getTranslations("emails.shared")
|
||||
|
||||
// 服务端获取数据
|
||||
const message = await getSharedMessage(token)
|
||||
|
||||
if (!message) {
|
||||
return (
|
||||
<SharedErrorPage
|
||||
title={tShared("messageNotFound")}
|
||||
subtitle={tShared("linkExpired")}
|
||||
error={tShared("linkInvalid")}
|
||||
description={tShared("linkInvalidDescription")}
|
||||
ctaText={tShared("createOwnEmail")}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return <SharedMessagePageClient message={message} />
|
||||
}
|
||||
Reference in New Issue
Block a user