UNPKG

@cross-nft-marketplace/auction-house-nft-components

Version:
25 lines (24 loc) 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NFTArtists = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const react_2 = require("react"); const useMediaContext_1 = require("../context/useMediaContext"); const NFTDataContext_1 = require("../context/NFTDataContext"); const InfoContainer_1 = require("./InfoContainer"); const AddressView_1 = require("../components/AddressView"); const NFTArtists = ({ className, actionArtists }) => { var _a; const { nft } = (0, react_2.useContext)(NFTDataContext_1.NFTDataContext); const { getStyles, style } = (0, useMediaContext_1.useMediaContext)(); const hasArtists = ((_a = nft === null || nft === void 0 ? void 0 : nft.artists) === null || _a === void 0 ? void 0 : _a.length) || 0 > 0; return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: hasArtists && style.theme.showArtist && (0, jsx_runtime_1.jsx)(InfoContainer_1.InfoContainer, { titleString: "ARTIST", className: className, children: (0, jsx_runtime_1.jsx)("div", { ...getStyles("fullInfoArtistsContainer"), children: nft.artists.map((artist, index) => { var _a; const artistAddress = { name: artist.name, wallet: (_a = artist.address) === null || _a === void 0 ? void 0 : _a.wallet }; return ((0, react_1.createElement)("div", { ...getStyles("artistsItem"), onClick: (e) => actionArtists(e, artist), key: `${artist}${index}` }, (0, jsx_runtime_1.jsx)(AddressView_1.AddressView, { address: artistAddress }))); }) }) }) })); }; exports.NFTArtists = NFTArtists;