-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
38 lines (33 loc) · 1.17 KB
/
App.tsx
File metadata and controls
38 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { useState } from 'react';
import Editor from './components/Editor';
import Teleprompter from './components/Teleprompter';
import { AppState } from './types';
const App: React.FC = () => {
const [mode, setMode] = useState<AppState>(AppState.EDITING);
const [script, setScript] = useState<string>(
"Bonjour et bienvenue. Ceci est une démonstration de l'application FlowPrompter. Elle écoute ce que vous dites et met en surbrillance les mots au fur et à mesure. C'est idéal pour les présentations, les discours ou les vidéos YouTube. Essayez de lire ce texte à haute voix pour voir la magie opérer."
);
const startPresentation = () => {
setMode(AppState.READING);
};
const backToEditor = () => {
setMode(AppState.EDITING);
};
return (
<main className="min-h-screen bg-zinc-950 text-zinc-100 selection:bg-indigo-500/30">
{mode === AppState.EDITING ? (
<Editor
value={script}
onChange={setScript}
onStart={startPresentation}
/>
) : (
<Teleprompter
script={script}
onBack={backToEditor}
/>
)}
</main>
);
};
export default App;