{"ast":null,"code":"import { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport axios from 'axios';\nimport React from 'react';\nimport BuildHeader from '../../components/header.js';\nexport default function buildNews(fulldataset) {\n  var newsArticle = fulldataset.fulldataset.newsArticleData;\n  var headerData = fulldataset.fulldataset.headerdata;\n  console.log(newsArticle.newsBody);\n  var newsData = [];\n\n  for (var paragraph in newsArticle.newsBody) {\n    newsData.push( /*#__PURE__*/_jsx(\"p\", {\n      className: \"mb-2 pl-2\",\n      children: newsArticle.newsBody[paragraph]\n    }));\n  }\n\n  return /*#__PURE__*/_jsxs(\"div\", {\n    children: [/*#__PURE__*/_jsx(BuildHeader, {\n      headerData: headerData\n    }), /*#__PURE__*/_jsx(\"div\", {\n      className: \"container mx-auto\",\n      children: /*#__PURE__*/_jsxs(\"div\", {\n        className: \"my-4\",\n        children: [/*#__PURE__*/_jsx(\"h2\", {\n          className: \"text-3xl\",\n          children: newsArticle.newsTitle\n        }), /*#__PURE__*/_jsx(\"h3\", {\n          className: \"text-md mb-4 pl-4 text-gray-400\",\n          children: \"Written by \" + newsArticle.newsAuthor + \" on \" + newsArticle.newsDate\n        }), newsData]\n      })\n    })]\n  });\n}\nexport async function getServerSideProps(context) {\n  const urlData = context.resolvedUrl.split('?')[1];\n  const res = await axios.get('https://goallinestats.com/AHA/newsJSON.php?' + urlData);\n  const dataset = res.data;\n  const index = await axios.get('https://goallinestats.com/AHA/headerJSON.php?' + urlData);\n  const indexData = index.data;\n  const fulldataset = {\n    headerdata: indexData,\n    newsArticleData: dataset\n  };\n  return {\n    props: {\n      fulldataset\n    }\n  };\n}","map":null,"metadata":{},"sourceType":"module"}