{"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 Head from 'next/head';\nimport MakeTable from '../../components/table.js';\nimport BuildHeader from '../../components/header.js';\nimport TableBuilder from '../../components/tablefilter.js';\n\nfunction teamHistory({\n  fulldataset\n}) {\n  if (fulldataset.goalieBox.dataarray && fulldataset.goalieBox.dataarray.length > 0) {\n    var visibleGoalieBox = /*#__PURE__*/_jsx(MakeTable, {\n      currentset: fulldataset.goalieBox\n    });\n  } else {\n    var visibleGoalieBox = '';\n  }\n\n  if (fulldataset.skaterBox.dataarray && fulldataset.skaterBox.dataarray.length > 0) {\n    var visibleSkaterBox = /*#__PURE__*/_jsx(MakeTable, {\n      currentset: fulldataset.skaterBox\n    });\n  } else {\n    var visibleSkaterBox = '';\n  }\n\n  if (fulldataset.goalieStats.dataarray && fulldataset.goalieStats.dataarray.length > 0) {\n    var visibleGoalieStats = /*#__PURE__*/_jsx(MakeTable, {\n      currentset: fulldataset.goalieStats\n    });\n  } else {\n    var visibleGoalieBox = '';\n  }\n\n  if (fulldataset.skaterStats.dataarray && fulldataset.skaterStats.dataarray.length > 0) {\n    var visibleSkaterStats = /*#__PURE__*/_jsx(MakeTable, {\n      currentset: fulldataset.skaterStats\n    });\n  } else {\n    var visibleGoalieBox = '';\n  }\n\n  return /*#__PURE__*/_jsxs(\"div\", {\n    children: [/*#__PURE__*/_jsx(Head, {\n      children: /*#__PURE__*/_jsx(\"title\", {\n        children: \"Goallinestats - \" + fulldataset.headerdata['header'] + \" Player Profile\"\n      })\n    }), /*#__PURE__*/_jsx(BuildHeader, {\n      headerData: fulldataset.headerdata\n    }), /*#__PURE__*/_jsxs(\"div\", {\n      className: \"container mx-auto\",\n      children: [/*#__PURE__*/_jsx(\"h1\", {\n        className: \"text-2xl\",\n        children: \"Recent Games\"\n      }), visibleGoalieBox, visibleSkaterBox, /*#__PURE__*/_jsx(\"h1\", {\n        className: \"text-2xl\",\n        children: \"History\"\n      }), visibleGoalieStats, visibleSkaterStats]\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/playercardJSON.php?' + urlData);\n  const dataset = res.data;\n  const index = await axios.get('/phpAPI/headerJSON.php?' + urlData);\n  const indexData = index.data;\n  console.log(dataset);\n  const fulldataset = {\n    headerdata: indexData,\n    skaterBox: dataset.skaterBoxScore,\n    skaterStats: dataset.skaterTable,\n    goalieBox: dataset.goalieBoxScore,\n    goalieStats: dataset.goalieTable\n  };\n  return {\n    props: {\n      fulldataset\n    }\n  };\n}","map":null,"metadata":{},"sourceType":"module"}