Files
erika/app/share/page.tsx
T

39 lines
1.6 KiB
TypeScript

import { getServerSession } from "next-auth";
import { LoginDialog } from "@/components/login-dialog";
import { authOptions } from "@/lib/auth/auth-options";
import { getSessionDiscordId } from "@/lib/auth/auth";
import { ShareUploadClient } from "@/app/share/upload-client";
export const dynamic = "force-dynamic";
export default async function SharePage() {
const session = await getServerSession(authOptions);
const discordId = getSessionDiscordId(session);
if (!discordId) {
return (
<LoginDialog
title="เข้าสู่ระบบก่อนแชร์ข้อความ"
description="ใช้บัญชี Discord เพื่อยืนยันผู้เผยแพร่ก่อนสร้างลิงก์แชร์"
/>
);
}
return (
<div className="flex flex-col gap-6">
<div className="max-w-2xl">
<p className="mb-2 font-mono text-xs uppercase tracking-[0.18em] text-muted-foreground">
New public paste
</p>
<h1 className="text-3xl font-bold tracking-tight sm:text-4xl">
วางข้อความ แล้วส่งลิงก์ต่อ
</h1>
<p className="mt-3 text-sm leading-6 text-muted-foreground sm:text-base">
เนื้อหาหลักจะถูกเก็บตามที่พิมพ์ทุกตัวอักษร คนที่มีลิงก์สามารถเปิดอ่านได้โดยไม่ต้องเข้าสู่ระบบ
</p>
</div>
<ShareUploadClient />
</div>
);
}