- launch.ts policy: LAUNCH_MODE=free_early_access default; effective access = published && (free || early); intended tier (access) never rewritten - Billing off server-side: /api/subscribe 503 honest copy; subscribe CTAs render disabled 'قريباً' from first paint; /subscription early-access panel + /api/notify (LaunchNotifications) with honest 503 when mail transport off - Signup trust: verification email at signup (Users afterChange), no confirm-password, 429 message fidelity, typo suggestion, live password hint - Agent pipeline: pickFields strips access/readingMinutes, sourceId dedup, secret-scan 422 (pattern names only), string-content rejected (was silently replaced), publish stays explicit opt-in - lexical.ts: root unwrap fix — lexicalToText/countLexicalWords returned 0 for real serialized trees (secret scan + readingMinutes were inert) - llms-full.txt: fetchIndexDocs(true) — bodies were never selected - Content honesty: contentType/authorName/sourceId fields + migration, readingMinutes computed at write (160 wpm) + backfill script, byline, 'حُدّث' freshness - SEO/AI-SEO: metadata rewrite (published-only, og:image 1200x630), Article + BreadcrumbList + FAQPage + Organization JSON-LD, isAccessibleForFree honest, table renderer, robots AI-crawler policy (10 named bots), llms.txt + llms-full.txt, /topics/* hubs + sitemap, noindex auth pages, www 301 - Ops: backup-db.sh (restore rehearsed on VPS), docs copies (launch readiness + marketing audit + owner-inputs for L-03), GLOSSARY.md entries Verified: tsc --noEmit 0, npm run build 0, local smoke (ghost VIP read, subscribe/notify/agent APIs, signup token, 429 on 6th, llms/topics/sitemap, og:image/JSON-LD)
54 lines
2.3 KiB
TypeScript
54 lines
2.3 KiB
TypeScript
import { getPayload } from 'payload'
|
|
import { headers } from 'next/headers'
|
|
import Topnav from '@/components/topnav'
|
|
import Footer from '@/components/footer'
|
|
import AccountSettingsClient from './client'
|
|
import { formatDate } from '@/lib/format'
|
|
import { billingEnabled } from '@/lib/launch'
|
|
import configPromise from '@payload-config'
|
|
import '../styles/account-settings.css'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
export const metadata = { title: 'إعدادات الحساب' }
|
|
|
|
export default async function AccountSettingsPage() {
|
|
const payload = await getPayload({ config: configPromise })
|
|
const { user } = await payload.auth({ headers: await headers() })
|
|
|
|
return (
|
|
<div id="site" className="site-page page-account-settings">
|
|
<Topnav viewer={user} />
|
|
{user ? (
|
|
<main id="content">
|
|
<section className="page-head" data-od-id="settings-header"><div className="container">
|
|
<p className="crumb">حسابك في أنور بآي</p>
|
|
<h1 data-od-id="settings-title">إعدادات الحساب</h1>
|
|
<p className="sub"><bdi>{String(user.email)}</bdi> · عضو منذ {user.createdAt ? formatDate(String(user.createdAt)) : 'اليوم'}</p>
|
|
</div></section>
|
|
<section className="container settings-layout" data-od-id="settings-layout">
|
|
<AccountSettingsClient
|
|
email={String(user.email)}
|
|
userId={Number(user.id)}
|
|
fullName={(user.fullName as string) || ''}
|
|
role={((user.role as string) || 'free')}
|
|
billingEnabled={billingEnabled()}
|
|
/>
|
|
</section>
|
|
</main>
|
|
) : (
|
|
<main id="content" className="gate">
|
|
<section className="gate-card">
|
|
<h1>سجّل الدخول لإدارة حسابك</h1>
|
|
<p>من هنا تعدّل اسمك وكلمة المرور وتفضيلات الرسائل، وتدير عضويتك.</p>
|
|
<div className="actions">
|
|
<a className="btn btn-primary" href="/login?next=%2Faccount-settings">تسجيل الدخول</a>
|
|
<a className="btn btn-quiet" href="/signup">إنشاء حساب مجاني</a>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
)}
|
|
<Footer />
|
|
</div>
|
|
)
|
|
}
|