feat(pitch-deck): show version name + status in preview banner
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import PitchDeck from '@/components/PitchDeck'
|
||||
export default function PreviewPage() {
|
||||
const { versionId } = useParams<{ versionId: string }>()
|
||||
const [data, setData] = useState<PitchData | null>(null)
|
||||
const [versionMeta, setVersionMeta] = useState<{ name: string; status: string } | null>(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
const [lang, setLang] = useState<Language>('de')
|
||||
@@ -24,7 +25,13 @@ export default function PreviewPage() {
|
||||
if (!r.ok) throw new Error((await r.json().catch(() => ({}))).error || 'Failed to load')
|
||||
return r.json()
|
||||
})
|
||||
.then(setData)
|
||||
.then(d => {
|
||||
if (d._version) {
|
||||
setVersionMeta(d._version)
|
||||
delete d._version
|
||||
}
|
||||
setData(d)
|
||||
})
|
||||
.catch(e => setError(e.message))
|
||||
.finally(() => setLoading(false))
|
||||
}, [versionId])
|
||||
@@ -57,8 +64,8 @@ export default function PreviewPage() {
|
||||
return (
|
||||
<div className="relative">
|
||||
{/* Preview banner */}
|
||||
<div className="fixed top-0 left-0 right-0 z-[100] bg-amber-500/90 text-black text-center py-1.5 text-xs font-semibold">
|
||||
PREVIEW MODE — This is how investors will see this version
|
||||
<div className="fixed top-0 left-0 right-0 z-[100] bg-amber-500/90 text-black text-center py-1.5 text-xs font-semibold tracking-wide">
|
||||
PREVIEW: {versionMeta?.name ?? 'Loading...'} — {versionMeta?.status === 'draft' ? 'Draft' : 'Committed'}
|
||||
</div>
|
||||
<PitchDeck
|
||||
lang={lang}
|
||||
|
||||
Reference in New Issue
Block a user