@@ -8,7 +8,23 @@ import { useStore } from "zustand";
88import { displayOptionStore , yDocOptionStore } from "./lib/store" ;
99
1010export 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 ) ;
1228
1329 useEffect ( ( ) => {
1430 const prev = displayOptionStore . getState ( ) . display ;
@@ -34,24 +50,15 @@ export default function App() {
3450 } , [ inputBuffer , apiVersion ] ) ;
3551
3652 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+ />
5562 ) ;
5663}
5764
0 commit comments