GoScrobble/web/node_modules/.cache/babel-loader/c5fd6bba6fb19b748e19ab1ec9013f67.json

1 line
7.2 KiB
JSON

{"ast":null,"code":"var _jsxFileName = \"/app/src/Components/TopUserTable.js\",\n _s = $RefreshSig$();\n\nimport { Link } from 'react-router-dom';\nimport './TopUserTable.css';\nimport React, { useState, useEffect } from 'react';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getTopUsersForTrack, getTopUsersForAlbum, getTopUsersForArtist } from '../Api/index';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst TopUserTable = props => {\n _s();\n\n const [loading, setLoading] = useState(true);\n const [data, setData] = useState({});\n useEffect(() => {\n if (!props.trackuuid && !props.albumuuid && !props.artistuuid) {\n return false;\n }\n\n if (props.trackuuid) {\n getTopUsersForTrack(props.trackuuid).then(data => {\n setData(data);\n setLoading(false);\n });\n } else if (props.albumuuid) {\n getTopUsersForAlbum(props.albumuuid).then(data => {\n setData(data);\n setLoading(false);\n });\n } else if (props.artistuuid) {\n getTopUsersForArtist(props.artistuuid).then(data => {\n setData(data);\n setLoading(false);\n });\n }\n }, [props.trackuuid, props.albumuuid, props.artistuuid]);\n\n if (loading) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageWrapper\",\n children: /*#__PURE__*/_jsxDEV(ScaleLoader, {\n color: \"#6AD7E5\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 9\n }, this);\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n width: `100%`,\n display: `flex`,\n flexWrap: `wrap`,\n marginLeft: `20px`,\n textAlign: `left`\n },\n children: data.items && data.items.map(function (element) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n style: {\n width: `100%`,\n padding: `2px`\n },\n children: [/*#__PURE__*/_jsxDEV(Link, {\n to: \"/u/\" + element.user_name,\n children: element.user_name\n }, \"user\" + element.user_uuid, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 21\n }, this), \" (\", element.count, \")\"]\n }, \"box\" + element.user_uuid, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 23\n }, this);\n })\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 9\n }, this);\n};\n\n_s(TopUserTable, \"S2S601Rg9QIjK0Aph/7Sqrrdt3U=\");\n\n_c = TopUserTable;\nexport default TopUserTable;\n\nvar _c;\n\n$RefreshReg$(_c, \"TopUserTable\");","map":{"version":3,"sources":["/app/src/Components/TopUserTable.js"],"names":["Link","React","useState","useEffect","ScaleLoader","getTopUsersForTrack","getTopUsersForAlbum","getTopUsersForArtist","TopUserTable","props","loading","setLoading","data","setData","trackuuid","albumuuid","artistuuid","then","width","display","flexWrap","marginLeft","textAlign","items","map","element","padding","user_name","user_uuid","count"],"mappings":";;;AAAA,SAASA,IAAT,QAAqB,kBAArB;AACA,OAAO,oBAAP;AACA,OAAOC,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAOC,WAAP,MAAwB,4BAAxB;AACA,SAASC,mBAAT,EAA8BC,mBAA9B,EAAmDC,oBAAnD,QAA+E,cAA/E;;;AAEA,MAAMC,YAAY,GAAIC,KAAD,IAAW;AAAA;;AAC5B,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBT,QAAQ,CAAC,IAAD,CAAtC;AACA,QAAM,CAACU,IAAD,EAAOC,OAAP,IAAkBX,QAAQ,CAAC,EAAD,CAAhC;AAGAC,EAAAA,SAAS,CAAC,MAAM;AACZ,QAAI,CAACM,KAAK,CAACK,SAAP,IAAoB,CAACL,KAAK,CAACM,SAA3B,IAAwC,CAACN,KAAK,CAACO,UAAnD,EAA+D;AAC7D,aAAO,KAAP;AACD;;AAED,QAAIP,KAAK,CAACK,SAAV,EAAqB;AACnBT,MAAAA,mBAAmB,CAACI,KA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,KAAK,EAAG,MAAT;AAAgBQ,UAAAA,OAAO,EAAG;AAA1B,SAAZ;AAAA,gCACF,QAAC,IAAD;AAEI,UAAA,EAAE,EAAE,QAAMD,OAAO,CAACE,SAFtB;AAAA,oBAGGF,OAAO,CAACE;AAHX,WACS,SAASF,OAAO,CAACG,SAD1B;AAAA;AAAA;AAAA;AAAA,gBADE,QAI6BH,OAAO,CAACI,KAJrC;AAAA,SAAkD,QAAQJ,OAAO,CAACG,SAAlE;AAAA;AAAA;AAAA;AAAA,cAAP;AAOF,KARD;AATJ;AAAA;AAAA;AAAA;AAAA,UADJ;AAsBH,CA7DD;;GAAMpB,Y;;KAAAA,Y;AA+DN,eAAeA,YAAf","sourcesContent":["import { Link } from 'react-router-dom';\nimport './TopUserTable.css'\nimport React, { useState, useEffect } from 'react';\nimport ScaleLoader from 'react-spinners/ScaleLoader';\nimport { getTopUsersForTrack, getTopUsersForAlbum, getTopUsersForArtist } from '../Api/index'\n\nconst TopUserTable = (props) => {\n const [loading, setLoading] = useState(true);\n const [data, setData] = useState({});\n\n\n useEffect(() => {\n if (!props.trackuuid && !props.albumuuid && !props.artistuuid) {\n return false;\n }\n\n if (props.trackuuid) {\n getTopUsersForTrack(props.trackuuid)\n .then(data => {\n setData(data);\n setLoading(false);\n })\n } else if (props.albumuuid) {\n getTopUsersForAlbum(props.albumuuid)\n .then(data => {\n setData(data);\n setLoading(false);\n })\n } else if (props.artistuuid) {\n getTopUsersForArtist(props.artistuuid)\n .then(data => {\n setData(data);\n setLoading(false);\n })\n }\n }, [props.trackuuid, props.albumuuid, props.artistuuid])\n\n if (loading) {\n return (\n <div className=\"pageWrapper\">\n <ScaleLoader color=\"#6AD7E5\" />\n </div>\n )\n }\n\n return (\n <div style={{\n width: `100%`,\n display: `flex`,\n flexWrap: `wrap`,\n marginLeft: `20px`,\n textAlign: `left`,\n }}>\n {\n data.items &&\n data.items.map(function (element) {\n return <div style={{width: `100%`, padding: `2px`}} key={\"box\" + element.user_uuid}>\n <Link\n key={\"user\" + element.user_uuid}\n to={\"/u/\"+element.user_name}\n >{element.user_name}</Link> ({element.count})\n </div>;\n\n })\n }\n </div>\n );\n}\n\nexport default TopUserTable;"]},"metadata":{},"sourceType":"module"}