{"version":3,"file":"card.15601970.js","sources":["../../../app/frontend/entrypoints/page/home/section/pickupMusics/card.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useRecoilState } from 'recoil'\nimport { currentPlayState } from '../../../../../src/atoms/CurrentPlayAtom'\nimport { pageState } from '../../../../../src/atoms/PageAtom'\nimport { pastPageState } from '../../../../../src/atoms/PastPageAtom'\n\ntype NFT = {\n chain_id: number\n chain_name: string\n contract_address: string\n token_id: string\n name: string\n image: string\n trial_sound: string\n sound: string\n artist_name: string\n artist_public_id: string\n genres: Genre[]\n}\n\ntype Props = {\n nft: NFT\n playMusic: (target: {\n chain_id: number\n contract_address: string\n token_id: string\n }) => void\n\n postRecommendResult: () => void\n}\n\nfunction HomePickupMusicCard(props: Props) {\n const { t } = useTranslation()\n const [page, setPage] = useRecoilState(pageState)\n const [, setPastPage] = useRecoilState(pastPageState)\n const [currentPlay, setCurrentPlay] = useRecoilState(currentPlayState)\n\n return (\n
\n \n
\n
\n
\n
\n {props.nft.genres.length > 0 ? (\n props.nft.genres.map((genre: Genre) => (\n \n ))\n ) : (\n \n )}\n
\n {\n setPastPage(page)\n setPage(\n `nft/${props.nft.chain_name}/${props.nft.contract_address}/${props.nft.token_id}/detail`\n )\n }}\n >\n {props.nft.name}\n \n {\n setPage(`artists/${props.nft.artist_public_id}`)\n setPastPage(page)\n }}\n >\n \n {props.nft.artist_name}\n \n {currentPlay.chainId === props.nft.chain_id &&\n currentPlay.contractAddress === props.nft.contract_address &&\n currentPlay.tokenId === props.nft.token_id &&\n currentPlay.playStatus ? (\n {\n const dupCurrentPlay = Object.assign({}, currentPlay)\n dupCurrentPlay.outerPause = true\n setCurrentPlay(dupCurrentPlay)\n }}\n >\n {t('parts.pauseButton.text')}\n \n ) : (\n {\n props.playMusic({\n chain_id: props.nft.chain_id,\n contract_address: props.nft.contract_address,\n token_id: props.nft.token_id,\n })\n props.postRecommendResult()\n }}\n >\n {t('parts.listeningButton.text')}\n \n )}\n
\n
\n \n \n )\n}\n\nexport default HomePickupMusicCard\n"],"names":["HomePickupMusicCard","props","t","useTranslation","page","setPage","useRecoilState","pageState","setPastPage","pastPageState","currentPlay","setCurrentPlay","currentPlayState","backgroundImage","nft","image","_jsx","_jsxs","genres","length","map","genre","name","public_id","chain_name","contract_address","token_id","artist_public_id","artist_name","chainId","chain_id","contractAddress","tokenId","playStatus","dupCurrentPlay","Object","assign","outerPause","playMusic","postRecommendResult"],"mappings":"4TA+BA,SAASA,EAAoBC,EAAc,CACnC,KAAA,CAAEC,EAAAA,GAAMC,EAAgB,EACxB,CAACC,EAAMC,CAAO,EAAIC,EAAeC,CAAS,EAC1C,EAAGC,CAAW,EAAIF,EAAeG,CAAa,EAC9C,CAACC,EAAaC,CAAc,EAAIL,EAAeM,CAAgB,EAErE,SACE,MAAA,CAAK,UAAU,gBAAe,WAC5B,MAAA,CACE,UAAU,QACV,MAAO,CACLC,gBAAkB,OAAMZ,EAAMa,IAAIC,QACpC,EAAE,WAEF,MAAA,CAAK,UAAU,gBAAe,SAC5B,CAAAC,EAAA,MAAA,CACE,UAAU,QACV,MAAO,CACLH,gBAAkB,OAAMZ,EAAMa,IAAIC,QACpC,CAAA,CAAE,EAEJE,EAAA,MAAA,CAAK,UAAU,QAAO,SACpB,CAAAD,EAAA,MAAA,CAAK,UAAU,SAAQ,SACpBf,EAAMa,IAAII,OAAOC,OAAS,EACzBlB,EAAMa,IAAII,OAAOE,IAAKC,KACpB,SAAA,CAAQ,UAAU,QAAO,SACtBA,EAAMC,MADsBD,EAAME,SAAS,CAG/C,IAED,SAAA,CAAQ,UAAU,QAAO,SAAA,SAAA,CAAA,CAAA,CAC1B,EAEHP,EAAA,SAAA,CACE,UAAU,QACV,QAAS,IAAM,CACbR,EAAYJ,CAAI,EAEbC,EAAA,OAAMJ,EAAMa,IAAIU,cAAcvB,EAAMa,IAAIW,oBAAoBxB,EAAMa,IAAIY,iBAAiB,CAE5F,EAAE,SAEDzB,EAAMa,IAAIQ,IAAAA,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