@@ -8,7 +8,23 @@ import { useStore } from "zustand";
8
8
import { displayOptionStore , yDocOptionStore } from "./lib/store" ;
9
9
10
10
export default function App ( ) {
11
- const { apiVersion, inputBuffer } = useStore ( yDocOptionStore ) ;
11
+ return (
12
+ < div className = "flex h-screen bg-gray-900 text-white" >
13
+ < Sidebar />
14
+ < main className = "flex-1 flex flex-col p-4" >
15
+ < InputContainer />
16
+ < div className = "flex-1 gap-4 grid grid-cols-2 overflow-auto bg-gray-800 rounded-lg p-4 [&>div]:px-4 [&>div]:py-2" >
17
+ < MainViewer />
18
+ < SideViewer />
19
+ </ div >
20
+ </ main >
21
+ </ div >
22
+ ) ;
23
+ }
24
+
25
+ function InputContainer ( ) {
26
+ const apiVersion = useStore ( yDocOptionStore , ( s ) => s . apiVersion ) ;
27
+ const inputBuffer = useStore ( yDocOptionStore , ( s ) => s . inputBuffer ) ;
12
28
13
29
useEffect ( ( ) => {
14
30
const prev = displayOptionStore . getState ( ) . display ;
@@ -34,24 +50,15 @@ export default function App() {
34
50
} , [ inputBuffer , apiVersion ] ) ;
35
51
36
52
return (
37
- < div className = "flex h-screen bg-gray-900 text-white" >
38
- < Sidebar />
39
- < main className = "flex-1 flex flex-col p-4" >
40
- < Input
41
- type = "text"
42
- placeholder = "Enter HEX state here"
43
- value = { inputBuffer }
44
- onChange = { ( e ) =>
45
- yDocOptionStore . setState ( { inputBuffer : e . target . value } )
46
- }
47
- className = "mb-4 bg-gray-800 text-white border-gray-700"
48
- />
49
- < div className = "flex-1 gap-4 grid grid-cols-2 overflow-auto bg-gray-800 rounded-lg p-4 [&>div]:px-4 [&>div]:py-2" >
50
- < MainViewer />
51
- < SideViewer />
52
- </ div >
53
- </ main >
54
- </ div >
53
+ < Input
54
+ type = "text"
55
+ placeholder = "Enter HEX state here"
56
+ value = { inputBuffer }
57
+ onChange = { ( e ) =>
58
+ yDocOptionStore . setState ( { inputBuffer : e . target . value } )
59
+ }
60
+ className = "mb-4 bg-gray-800 text-white border-gray-700"
61
+ />
55
62
) ;
56
63
}
57
64
0 commit comments