{"ast":null,"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport axios from 'axios';\nimport Head from 'next/head';\nimport React from 'react';\nimport BuildHeader from '../../components/header.js';\nimport MakeTable from '../../components/table.js';\nimport TableBuilder from '../../components/tablefilter.js';\n\nfunction teamHistory({\n  fulldataset\n}) {\n  return /*#__PURE__*/_jsxs(\"div\", {\n    children: [/*#__PURE__*/_jsx(BuildHeader, {\n      headerData: fulldataset.headerdata\n    }), /*#__PURE__*/_jsxs(\"div\", {\n      className: \"container mx-auto\",\n      children: [/*#__PURE__*/_jsx(\"h1\", {\n        className: \"text-3xl py-2\",\n        children: \"Current Season Stats:\"\n      }), /*#__PURE__*/_jsx(MakeTable, {\n        currentset: fulldataset.currentdataset\n      })]\n    }), /*#__PURE__*/_jsx(\"div\", {\n      className: \"container mx-auto\",\n      children: /*#__PURE__*/_jsx(TableBuilder, {\n        props: fulldataset.historydataset\n      })\n    })]\n  });\n}\n\nexport default teamHistory;\nexport async function getServerSideProps(context) {\n  const urlData = context.resolvedUrl.split('?')[1];\n  const res = await axios.get('/phpAPI/teamstatsJSON.php?request=current&' + urlData);\n  const dataset = res.data;\n  const reshistory = await axios.get('/phpAPI/teamstatsJSON.php?request=history&' + urlData);\n  const historydataset = reshistory.data;\n  const index = await axios.get('/phpAPI/headerJSON.php?' + urlData);\n  const indexData = index.data;\n  const fulldataset = {\n    headerdata: indexData,\n    currentdataset: dataset,\n    historydataset: historydataset\n  }; // Pass data to the page via props\n\n  return {\n    props: {\n      fulldataset\n    }\n  };\n}","map":null,"metadata":{},"sourceType":"module"}