30a9165497
Build pitch-deck / build-push-deploy (push) Successful in 1m35s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 39s
CI / test-python-voice (push) Successful in 32s
CI / test-bqas (push) Successful in 30s
Adds is_showcase boolean to pitch_investors; when set, filters out financials, the ask, cap table, assumptions, finanzplan, risks, and intro-presenter slides. Slide navigation is fully dynamic — progress bar and counts update accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
967 B
TypeScript
45 lines
967 B
TypeScript
'use client'
|
|
|
|
import { useState, useEffect, useCallback } from 'react'
|
|
|
|
export interface Investor {
|
|
id: string
|
|
email: string
|
|
name: string | null
|
|
company: string | null
|
|
status: string
|
|
last_login_at: string | null
|
|
login_count: number
|
|
created_at: string
|
|
is_showcase: boolean
|
|
}
|
|
|
|
export function useAuth() {
|
|
const [investor, setInvestor] = useState<Investor | null>(null)
|
|
const [loading, setLoading] = useState(true)
|
|
|
|
useEffect(() => {
|
|
async function fetchMe() {
|
|
try {
|
|
const res = await fetch('/api/auth/me')
|
|
if (res.ok) {
|
|
const data = await res.json()
|
|
setInvestor(data.investor)
|
|
}
|
|
} catch {
|
|
// Not authenticated
|
|
} finally {
|
|
setLoading(false)
|
|
}
|
|
}
|
|
fetchMe()
|
|
}, [])
|
|
|
|
const logout = useCallback(async () => {
|
|
await fetch('/api/auth/logout', { method: 'POST' })
|
|
window.location.href = '/auth'
|
|
}, [])
|
|
|
|
return { investor, loading, logout }
|
|
}
|