// Public landing — URL `/`. Pure static content; pre-renders to flat HTML.
import type { ReactNode } from 'react'
import type { PageMeta } from '@voltro/web'
import { T } from '@voltro/i18n'
import { getCatalog } from '../../locales'

export const renderMode = 'static' as const

export const meta = ({ locale }: { readonly locale: string }): PageMeta => ({
  title: getCatalog(locale)['meta.landing.title'],
  description: getCatalog(locale)['meta.landing.description'],
})

export default function Landing(): ReactNode {
  return (
    <section className="hero">
      <h1><T id="landing.heading" /></h1>
      <p className="muted">
        <T
          id="landing.body"
          values={{
            strong: (c: ReactNode) => <strong>{c}</strong>,
            code: (c: ReactNode) => <code>{c}</code>,
          }}
        />
      </p>
      <p style={{ marginTop: '1.5rem' }}>
        <a className="btn" href="/login"><T id="landing.cta" /></a>
      </p>
    </section>
  )
}
