()
| 11 | import { isTauri, openExternal } from '@utils/platform'; |
| 12 | |
| 13 | const TutorialDemoBanner: React.FC = () => { |
| 14 | const { phase, demo } = useTutorialFlow(); |
| 15 | if (!demo || (phase !== 'building' && phase !== 'monitoring')) return null; |
| 16 | |
| 17 | const body = phase === 'monitoring' ? ( |
| 18 | <><strong>Observer is watching the demo.</strong> You'll get your notification when it finishes.</> |
| 19 | ) : isTauri() ? ( |
| 20 | <><strong>Your demo is open in your browser.</strong> Keep it visible on screen; Observer will watch that window.</> |
| 21 | ) : ( |
| 22 | <><strong>Your demo is open in a new tab.</strong> When Observer asks to share your screen, choose <strong>Chrome Tab → "{demoTabTitle(demo)}"</strong>.</> |
| 23 | ); |
| 24 | |
| 25 | return ( |
| 26 | <div className="mx-auto mt-3 w-[calc(100%-2rem)] max-w-2xl flex items-start gap-3 rounded-2xl bg-slate-900 text-white px-4 py-3 shadow-lg text-sm relative z-30"> |
| 27 | <div className="flex-1 min-w-0"> |
| 28 | <p>{body}</p> |
| 29 | <button onClick={() => void openExternal(demoUrl(demo))} className="mt-1 text-xs text-white/60 hover:text-white underline underline-offset-2 transition-colors"> |
| 30 | Tab didn't open? Open demo |
| 31 | </button> |
| 32 | </div> |
| 33 | <button onClick={tutorialFlow.reset} className="text-white/50 hover:text-white transition-colors flex-shrink-0" aria-label="Dismiss"> |
| 34 | <X className="h-4 w-4" /> |
| 35 | </button> |
| 36 | </div> |
| 37 | ); |
| 38 | }; |
| 39 | |
| 40 | export default TutorialDemoBanner; |
nothing calls this directly
no test coverage detected