fix(chat): extract SLIDE_ORDER to shared module for server-side import
useSlideNavigation.ts has 'use client' — server API routes can't import from it. Move SLIDE_ORDER to lib/slide-order.ts (no 'use client') and re-export from useSlideNavigation for backwards compat. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import pool from '@/lib/db'
|
||||
import { SLIDE_ORDER } from '@/lib/hooks/useSlideNavigation'
|
||||
import { SLIDE_ORDER } from '@/lib/slide-order'
|
||||
|
||||
const LITELLM_URL = process.env.LITELLM_URL || 'https://llm-dev.meghsakha.com'
|
||||
const LITELLM_MODEL = process.env.LITELLM_MODEL || 'gpt-oss-120b'
|
||||
|
||||
@@ -1,32 +1,10 @@
|
||||
'use client'
|
||||
|
||||
import { useState, useCallback } from 'react'
|
||||
import { SlideId } from '../types'
|
||||
import { SLIDE_ORDER, TOTAL_SLIDES } from '../slide-order'
|
||||
|
||||
export const SLIDE_ORDER: SlideId[] = [
|
||||
'intro-presenter',
|
||||
'cover',
|
||||
'problem',
|
||||
'solution',
|
||||
'product',
|
||||
'how-it-works',
|
||||
'market',
|
||||
'business-model',
|
||||
'traction',
|
||||
'competition',
|
||||
'team',
|
||||
'financials',
|
||||
'the-ask',
|
||||
'ai-qa',
|
||||
'annex-assumptions',
|
||||
'annex-architecture',
|
||||
'annex-gtm',
|
||||
'annex-regulatory',
|
||||
'annex-engineering',
|
||||
'annex-aipipeline',
|
||||
]
|
||||
|
||||
export const TOTAL_SLIDES = SLIDE_ORDER.length
|
||||
// Re-export for backwards compatibility
|
||||
export { SLIDE_ORDER, TOTAL_SLIDES }
|
||||
|
||||
export function useSlideNavigation() {
|
||||
const [currentIndex, setCurrentIndex] = useState(0)
|
||||
|
||||
26
pitch-deck/lib/slide-order.ts
Normal file
26
pitch-deck/lib/slide-order.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { SlideId } from './types'
|
||||
|
||||
export const SLIDE_ORDER: SlideId[] = [
|
||||
'intro-presenter',
|
||||
'cover',
|
||||
'problem',
|
||||
'solution',
|
||||
'product',
|
||||
'how-it-works',
|
||||
'market',
|
||||
'business-model',
|
||||
'traction',
|
||||
'competition',
|
||||
'team',
|
||||
'financials',
|
||||
'the-ask',
|
||||
'ai-qa',
|
||||
'annex-assumptions',
|
||||
'annex-architecture',
|
||||
'annex-gtm',
|
||||
'annex-regulatory',
|
||||
'annex-engineering',
|
||||
'annex-aipipeline',
|
||||
]
|
||||
|
||||
export const TOTAL_SLIDES = SLIDE_ORDER.length
|
||||
Reference in New Issue
Block a user