{"ast":null,"code":"var _jsxFileName = \"/Users/shoofle/Projects/the-forest/src/PageView.jsx\";\nimport logo from './logo.svg';\nimport './App.css';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst url = \"http://127.0.0.1:8000\";\nfunction fetchPage(id_we_want) {\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n statements: [{\n q: 'select * from pages where id=@val',\n params: {\n 'val': id_we_want\n }\n }]\n })\n }).then(res => res.json()).then(data => setCurrentPage(data[0].results.rows[0])).catch(err => console.log(err));\n}\nfunction setCurrentPage(row) {\n console.log(\"\" + row[0] + \" \" + row[1] + \" \" + row[2]);\n}\nfunction PageView({\n id,\n page_title,\n page_text\n}) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"App\",\n children: /*#__PURE__*/_jsxDEV(\"header\", {\n className: \"App-header\",\n children: [/*#__PURE__*/_jsxDEV(\"img\", {\n src: logo,\n className: \"App-logo\",\n alt: \"logo\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"Page-title\",\n children: /*#__PURE__*/_jsxDEV(\"h3\", {\n children: [id, \". \", page_title]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"Page-contents\",\n children: /*#__PURE__*/_jsxDEV(\"pre\", {\n children: page_text\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 5\n }, this);\n}\n_c = PageView;\nexport default PageView;\nvar _c;\n$RefreshReg$(_c, \"PageView\");","map":{"version":3,"names":["logo","jsxDEV","_jsxDEV","url","fetchPage","id_we_want","fetch","method","headers","body","JSON","stringify","statements","q","params","then","res","json","data","setCurrentPage","results","rows","catch","err","console","log","row","PageView","id","page_title","page_text","className","children","src","alt","fileName","_jsxFileName","lineNumber","columnNumber","_c","$RefreshReg$"],"sources":["/Users/shoofle/Projects/the-forest/src/PageView.jsx"],"sourcesContent":["import logo from './logo.svg';\nimport './App.css';\n\nconst url = \"http://127.0.0.1:8000\"\n\nfunction fetchPage(id_we_want) {\n fetch(url, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({\n statements: [{\n q: 'select * from pages where id=@val',\n params: {'val': id_we_want}\n }]\n })\n })\n .then((res) => res.json())\n .then((data) => setCurrentPage(data[0].results.rows[0]))\n .catch((err) => console.log(err));\n}\n\nfunction setCurrentPage(row) {\n console.log(\"\" + row[0] + \" \" + row[1] + \" \" + row[2]);\n}\n\nfunction PageView({id, page_title, page_text}) {\n return (\n
\n
\n \"logo\"\n
\n

{id}. {page_title}

\n
\n
\n
{page_text}
\n
\n
\n
\n );\n}\n\nexport default PageView;"],"mappings":";AAAA,OAAOA,IAAI,MAAM,YAAY;AAC7B,OAAO,WAAW;AAAC,SAAAC,MAAA,IAAAC,OAAA;AAEnB,MAAMC,GAAG,GAAG,uBAAuB;AAEnC,SAASC,SAASA,CAACC,UAAU,EAAE;EAC7BC,KAAK,CAACH,GAAG,EAAE;IACTI,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MAAC,cAAc,EAAE;IAAkB,CAAC;IAC7CC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MACnBC,UAAU,EAAE,CAAC;QACXC,CAAC,EAAE,mCAAmC;QACtCC,MAAM,EAAE;UAAC,KAAK,EAAET;QAAU;MAC5B,CAAC;IACH,CAAC;EACH,CAAC,CAAC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