jor / src /context /context.ts
Mentor AMP Frontend
Wire mock data workflows and interactive Mentor chat
eb48dcc
Raw History Blame Contribute Delete
626 Bytes
import { createContext } from 'react'
import type { ScreenName } from '../types'
export type InvestigationIntent = { kind: 'trace' | 'compare' | 'mentor' | 'scratchpad'; runId?: string; metric?: string; question?: string } | null
export type AppContextValue = {
activeScreen: ScreenName
setActiveScreen: (screen: ScreenName) => void
toast: string
notify: (message: string) => void
investigationIntent: InvestigationIntent
openInvestigation: (intent: NonNullable<InvestigationIntent>) => void
clearInvestigationIntent: () => void
}
export const AppContext = createContext<AppContextValue | undefined>(undefined)