@@ -9,6 +9,7 @@ import { AVAILABLE_FILES } from "./constants/files";
99const App = ( ) => {
1010 const [ theme , setTheme ] = useState < "light" | "dark" > ( "dark" ) ;
1111 const [ devMode , setDevMode ] = useState ( false ) ;
12+ const [ showBackrefs , setShowBackrefs ] = useState ( false ) ;
1213 const {
1314 selectedFile,
1415 data : testPage ,
@@ -17,6 +18,45 @@ const App = () => {
1718 handleFileChange,
1819 } = useFileLoader ( AVAILABLE_FILES [ 0 ] ) ;
1920
21+ // Sample backrefs for real_document.json
22+ const sampleBackrefs = [
23+ {
24+ end_idx : 82 ,
25+ block_id : "bk_01jxyv2pekf4bs9a82ayxsewga" ,
26+ start_idx : 0 ,
27+ } ,
28+ {
29+ end_idx : 125 ,
30+ block_id : "bk_01jxyv2pemfj3848ncdbap6xsa" ,
31+ start_idx : 8 ,
32+ } ,
33+ {
34+ end_idx : 100 ,
35+ block_id : "bk_01jxyv2pg6f8hbvmc960g8k58m" ,
36+ start_idx : 0 ,
37+ } ,
38+ {
39+ end_idx : 30 ,
40+ block_id : "bk_01jxyv2pepepaam6k48t1s5c1q" ,
41+ start_idx : 6 ,
42+ } ,
43+ {
44+ end_idx : 20 ,
45+ block_id : "bk_01jxyv2peqfx1vv7xa8zq4ajfx" ,
46+ start_idx : 0 ,
47+ } ,
48+ {
49+ end_idx : 200 ,
50+ block_id : "bk_01jxyv2ppcf6xvxsh278d4e2je" ,
51+ start_idx : 30 ,
52+ } ,
53+ {
54+ end_idx : 11 ,
55+ block_id : "bk_01jxyv2pesedv9dfz1e6ekbsj8" ,
56+ start_idx : 1 ,
57+ } ,
58+ ] ;
59+
2060 if ( error ) {
2161 return (
2262 < div
@@ -54,6 +94,8 @@ const App = () => {
5494 ) ;
5595 }
5696
97+ console . log ( "showBackrefs " , sampleBackrefs ) ;
98+
5799 return (
58100 < div
59101 style = { {
@@ -74,6 +116,8 @@ const App = () => {
74116 setDevMode = { setDevMode }
75117 theme = { theme }
76118 setTheme = { setTheme }
119+ showBackrefs = { showBackrefs }
120+ setShowBackrefs = { setShowBackrefs }
77121 />
78122
79123 < div
@@ -92,7 +136,7 @@ const App = () => {
92136 page = { testPage }
93137 theme = { theme }
94138 devMode = { devMode }
95- backrefs = { [ ] }
139+ backrefs = { showBackrefs ? sampleBackrefs : [ ] }
96140 components = { {
97141 page_delimiter : ( props ) => {
98142 return < PageDelimiter { ...props } /> ;
0 commit comments