mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
6.7 KiB
JSON
1 line
6.7 KiB
JSON
{"ast":null,"code":"var _jsxFileName = \"/app/src/Pages/Home.js\",\n _s = $RefreshSig$();\n\nimport logo from '../logo.png';\nimport '../App.css';\nimport './Home.css';\nimport HomeBanner from '../Components/HomeBanner';\nimport TopTable from '../Components/TopTable';\nimport React, { useState, useEffect } from 'react';\nimport { getTopTracks, getTopArtists } from '../Api/index';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Home = () => {\n _s();\n\n const [topArtists, setTopArtists] = useState({});\n const [topTracks, setTopTracks] = useState({});\n const [tableLoading, setTableLoading] = useState(true);\n useEffect(() => {\n // Fetch top tracks\n // if (topTracks && Object.keys(topTracks).length === 0) {\n // getTopTracks(\"0\", 7)\n // .then(data => {\n // setTopTracks(data.tracks)\n // })\n // }\n // Fetch top artists\n if (topArtists && Object.keys(topArtists).length === 0) {\n getTopArtists(\"0\", 7).then(data => {\n setTopArtists(data.artists);\n });\n }\n\n setTableLoading(false);\n }, [topTracks, topArtists]);\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(\"img\", {\n src: logo,\n className: \"App-logo\",\n alt: \"logo\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"homeItem\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n className: \"homeText\",\n children: \"GoScrobble is an open source music scrobbling service.\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n className: \"subHomeText\",\n children: \"Supports Spotify, Jellyfin, Navidrome / Subsonic / Airsonic.\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(HomeBanner, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(TopTable, {\n type: \"artist\",\n items: topArtists,\n loading: tableLoading,\n extraText: \"this week\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 5\n }, this);\n};\n\n_s(Home, \"G13JvKa3FG2kY4RDX4xE2MPcpzU=\");\n\n_c = Home;\nexport default Home;\n\nvar _c;\n\n$RefreshReg$(_c, \"Home\");","map":{"version":3,"sources":["/app/src/Pages/Home.js"],"names":["logo","HomeBanner","TopTable","React","useState","useEffect","getTopTracks","getTopArtists","Home","topArtists","setTopArtists","topTracks","setTopTracks","tableLoading","setTableLoading","Object","keys","length","then","data","artists"],"mappings":";;;AAAA,OAAOA,IAAP,MAAiB,aAAjB;AACA,OAAO,YAAP;AACA,OAAO,YAAP;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,YAAT,EAAuBC,aAAvB,QAA4C,cAA5C;;;AAEA,MAAMC,IAAI,GAAG,MAAM;AAAA;;AACjB,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BN,QAAQ,CAAC,EAAD,CAA5C;AACA,QAAM,CAACO,SAAD,EAAYC,YAAZ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AAC;AAA5E;AAAA;AAAA;AAAA;AAAA,YAZF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgBD,CAzCD;;GAAML,I;;KAAAA,I;AA2CN,eAAeA,IAAf","sourcesContent":["import logo from '../logo.png';\nimport '../App.css';\nimport './Home.css';\nimport HomeBanner from '../Components/HomeBanner';\nimport TopTable from '../Components/TopTable';\nimport React, { useState, useEffect } from 'react';\nimport { getTopTracks, getTopArtists } from '../Api/index'\n\nconst Home = () => {\n const [topArtists, setTopArtists] = useState({})\n const [topTracks, setTopTracks] = useState({})\n const [tableLoading, setTableLoading] = useState(true);\n\n useEffect(() => {\n // Fetch top tracks\n // if (topTracks && Object.keys(topTracks).length === 0) {\n // getTopTracks(\"0\", 7)\n // .then(data => {\n // setTopTracks(data.tracks)\n // })\n // }\n\n // Fetch top artists\n if (topArtists && Object.keys(topArtists).length === 0) {\n getTopArtists(\"0\", 7)\n .then(data => {\n setTopArtists(data.artists)\n })\n }\n\n setTableLoading(false);\n }, [topTracks, topArtists])\n\n return (\n <div className=\"pageWrapper\">\n <div className=\"homeContainer\">\n <div>\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n </div>\n <div className=\"homeItem\">\n <p className=\"homeText\">GoScrobble is an open source music scrobbling service.</p>\n <p className=\"subHomeText\">Supports Spotify, Jellyfin, Navidrome / Subsonic / Airsonic.</p>\n </div>\n </div>\n <HomeBanner />\n {/* <TopTable type=\"track\" items={topTracks} loading={tableLoading} /> */}\n <TopTable type=\"artist\" items={topArtists} loading={tableLoading} extraText=\"this week\" />\n </div>\n );\n}\n\nexport default Home;\n"]},"metadata":{},"sourceType":"module"} |