Files

84 lines
3.7 KiB
TypeScript

'use client'
import { Text, View, XStack, YStack } from '@hanzo/ui'
import { More } from '@hanzo/ui/marketing'
import { Loading } from '@/components/api/state'
import { useEnso } from '@/hooks/useEnso'
import { GPQA, RIVAL, said, tile } from '@/lib/enso'
import { gpqa } from '@/lib/home'
import { Board } from './Board'
import { Hold, Section, useSeen, useStill } from './chrome'
/**
* Frontier answers: GPQA Diamond, read from the research API's runs when the
* page opens (lib/enso). Enso routed leads (lib/home `gpqa`): its best tier on
* new questions set large against the best single model, the low-cost tier
* said by its cost (lib/enso `said`), and the board of both question sets.
* Without a routing, the router's board, and under its figure the cost line
* every page draws (lib/enso `tile`) while it holds.
*/
export default function Frontier() {
const reading = useEnso()
const [ref, seen] = useSeen(0.25)
const still = useStill()
const e = reading.state === 'ready' ? reading.data : null
const b = e ? gpqa(e) : null
if (reading.state === 'unreachable' || (e && !b)) return null
const n = e?.boards.find((x) => x.id === GPQA)?.rows[0]?.n
const low = e?.routing ? said(e.routing).find((l) => l.key === 'cheap') : null
const less = e && !e.routing ? tile(e) : null
return (
<Section
id="frontier"
label="GPQA.Diamond"
title="Frontier answers."
lede={`GPQA Diamond is ${n ? `${n} ` : ''}hard science questions, the same for every model. Each bar is a research run.`}
>
<View ref={ref}>
<Hold height={440}>
{b ? (
<View display="grid" gridTemplateColumns="minmax(0, 1fr)" gap={24} items="center" $lg={{ gridTemplateColumns: 'minmax(0, 0.7fr) minmax(0, 1.3fr)', gap: 48 }}>
<YStack gap={10} data-figure="enso">
<Text fontSize="3.5rem" lineHeight="3.5rem" $md={{ fontSize: '5rem', lineHeight: '5rem' }} fontWeight="500" color="var(--foreground)" $platform-web={{ letterSpacing: '-0.03em', fontVariantNumeric: 'tabular-nums' }}>
{b.lead.figure}
</Text>
<Text render="h3" fontSize="$5" lineHeight="$5" fontWeight="600" color="var(--foreground)">
{b.lead.who} on {b.label}
</Text>
{b.lead.set ? (
<Text fontFamily="$mono" fontSize="$2" lineHeight="$2" color="var(--muted-foreground)">
{b.lead.set}
</Text>
) : null}
<Text render="p" fontSize="$3" lineHeight="$4" color="var(--muted-foreground)">
{b.lead.note}
</Text>
{low ? (
<Text render="p" fontSize="$3" lineHeight="$4" color="var(--muted-foreground)" data-figure="low">
{low.text}.
</Text>
) : null}
{less ? (
<Text render="p" fontSize="$3" lineHeight="$4" color="var(--muted-foreground)" data-figure="cheaper">
<Text render="strong" fontWeight="600" color="var(--foreground)">
{less.figure}
</Text>{' '}
than {RIVAL.name}: {less.note}
</Text>
) : null}
<XStack gap={20} flexWrap="wrap">
<More href="/enso">Meet Enso →</More>
<More href="/benchmarks#enso">Every board →</More>
</XStack>
</YStack>
<Board b={b} title="GPQA.Diamond" play={seen} still={still} slot="frontier" />
</View>
) : (
<Loading what="Enso's research runs" />
)}
</Hold>
</View>
</Section>
)
}