import React, { useState } from 'react'; import { createRoot } from 'react-dom/client'; import SharedFileView from './components/shared-file-view/shared-file-view'; import SharedFileViewTip from './components/shared-file-view/shared-file-view-tip'; import SeafileCodeMirror from './components/seafile-codemirror'; import './css/text-file-view.css'; const { err, fileExt, fileContent } = window.shared.pageOptions; const FileContent = ({ lineWrapping }) => { if (err) { return ; } return (
); }; const SharedFileViewText = () => { let [lineWrapping, setLineWrapping] = useState(localStorage.getItem('sf_txt_file_line_wrapping') === 'true' || false); const updateLineWrapping = (newLineWrapping) => { setLineWrapping(newLineWrapping); }; return ( } updateLineWrapping={updateLineWrapping} lineWrapping={lineWrapping} canWrapLine={true} /> ); }; const root = createRoot(document.getElementById('wrapper')); root.render();