mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
The share card offers Hanzo, the products and the betas the member asked for, the rest under More by group. A topic picks the posts Shuffle offers, the link (/beta/for/<topic>, tagged utm_content) and the card it unfurls to: that page carries the topic's title, line and card, a canonical naming itself and the one noindex (lib/publish SHARES), and sends a person on to /beta with the query kept, so ref and the campaign land as before. lib/hanzo/topics is the list, its words the site's and BETAS's own. generate-og draws a card per topic from it, palette-quantized with sharp: 49 cards, 2.9 MB. The cards gate reads every card's rendered words. Claude-Session: https://claude.ai/code/session_017vrVus6PPBgP5YRzKV1iqW
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
'use client'
|
|
|
|
import { useEffect, useState } from 'react'
|
|
import { useRouter } from 'next/navigation'
|
|
import { Box, YStack } from '@hanzo/ui'
|
|
import { Action, Display, Eyebrow, Lede } from '@hanzo/ui/marketing'
|
|
import { useI18n } from '@hanzo/i18n/react'
|
|
import { getOgImageUrl } from '@/lib/constants/og'
|
|
import { HANZO, page, topic } from '@/lib/hanzo/topics'
|
|
|
|
/**
|
|
* The share page's body: the topic, its card, and the way on to /beta. Drawn into
|
|
* the export for a reader without scripts; a person with them is sent to /beta at
|
|
* once, with the query the link carried.
|
|
*/
|
|
export function Forward({ id }: { id: string }) {
|
|
const { t } = useI18n()
|
|
const router = useRouter()
|
|
const [query, setQuery] = useState('')
|
|
useEffect(() => {
|
|
const q = window.location.search
|
|
setQuery(q)
|
|
router.replace(`/beta${q}`)
|
|
}, [router])
|
|
const it = topic(id)!
|
|
return (
|
|
<Box minH="100vh" $platform-web={{ color: 'var(--foreground)' }}>
|
|
<YStack render="main" id="main" width="100%" maxW={720} mx="auto" px={16} py={64} gap={20}>
|
|
<Eyebrow>{it.group ? t('Beta ยท {group}', { group: t(it.group) }) : t('Beta')}</Eyebrow>
|
|
<Display>{it.id === HANZO ? t(it.title) : it.name}</Display>
|
|
<Lede>{t(it.line)}</Lede>
|
|
<img src={getOgImageUrl(page(id))} alt={it.name} width={1200} height={630} style={{ width: '100%', height: 'auto', display: 'block', borderRadius: 14 }} />
|
|
<Box>
|
|
<Action fill href={`/beta${query}`}>
|
|
{t('Get early access')}
|
|
</Action>
|
|
</Box>
|
|
</YStack>
|
|
</Box>
|
|
)
|
|
}
|