| 1 | import Link from "next/link"; |
| 2 | import { ACCOUNT_ENTRY_COPY } from "@/lib/content/account-entry"; |
| 3 | import { pickText } from "@/lib/i18n/dictionaries"; |
| 4 | import { |
| 5 | CANONICAL_MARK_SRC, |
| 6 | publicAuthAppDestination, |
| 7 | type PublicAuthKind, |
| 8 | } from "@/lib/public-auth-routes"; |
| 9 | |
| 10 | export function PublicAccountEntry({ |
| 11 | locale, |
| 12 | kind, |
| 13 | }: { |
| 14 | locale: string; |
| 15 | kind: Exclude<PublicAuthKind, "callback">; |
| 16 | }) { |
| 17 | const creating = kind === "sign-up"; |
| 18 | const copy = creating ? ACCOUNT_ENTRY_COPY.signUp : ACCOUNT_ENTRY_COPY.signIn; |
| 19 | const appHref = publicAuthAppDestination(kind, locale); |
| 20 | const otherHref = `/${locale}/${creating ? "signin" : "signup"}`; |
| 21 | |
| 22 | return ( |
| 23 | <div className="portal-home"> |
| 24 | <section className="portal-section"> |
| 25 | <div className="portal-container public-account-entry"> |
| 26 | {/* Pinned app-icon raster; see CANONICAL_MARK_SRC for its source asset. */} |
| 27 | {/* eslint-disable-next-line @next/next/no-img-element */} |
| 28 | <img |
| 29 | className="public-account-mark" |
| 30 | src={CANONICAL_MARK_SRC} |
| 31 | alt="" |
| 32 | width={64} |
| 33 | height={64} |
| 34 | /> |
| 35 | <p className="legal-doc-kicker">{pickText(copy.kicker, locale)}</p> |
| 36 | <h1>{pickText(copy.title, locale)}</h1> |
| 37 | <p className="portal-lede">{pickText(ACCOUNT_ENTRY_COPY.lede, locale)}</p> |
| 38 | <div className="portal-actions"> |
| 39 | <a className="portal-button portal-button-primary" href={appHref} data-usage={creating ? "signup" : "login"}> |
| 40 | {pickText(copy.action, locale)} |
| 41 | </a> |
| 42 | <Link className="portal-button portal-button-secondary" href={`/${locale}/install`}> |
| 43 | {pickText(ACCOUNT_ENTRY_COPY.installLocally, locale)} |
| 44 | </Link> |
| 45 | </div> |
| 46 | <p className="portal-meta"> |
| 47 | {pickText(copy.switchPrompt, locale)}{" "} |
| 48 | <Link href={otherHref} className="body-link"> |
| 49 | {pickText(copy.switchLabel, locale)} |
| 50 | </Link> |
| 51 | </p> |
| 52 | </div> |
| 53 | </section> |
| 54 | </div> |
| 55 | ); |
| 56 | } |
| 57 |