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

1 line
7.2 KiB
JSON
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
{"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,KAAK,CAACK,SAAP,CAAnB,CACGG,IADH,CACQL,IAAI,IAAI;AACZC,QAAAA,OAAO,CAACD,IAAD,CAAP;AACAD,QAAAA,UAAU,CAAC,KAAD,CAAV;AACD,OAJH;AAKD,KAND,MAMO,IAAIF,KAAK,CAACM,SAAV,EAAqB;AAC1BT,MAAAA,mBAAmB,CAACG,KAAK,CAACM,SAAP,CAAnB,CACGE,IADH,CACQL,IAAI,IAAI;AACZC,QAAAA,OAAO,CAACD,IAAD,CAAP;AACAD,QAAAA,UAAU,CAAC,KAAD,CAAV;AA