import React, {useEffect, useState} from 'react' import {getArtist, getArtistDiscs} from "../services/entity_service"; import {CoverWithCaption} from './CoverArt'; import ReactJson from "react-json-view"; export const Discs = (props) => { const discs = props.discs ? props.discs.discs : null; const paginate = props.discs ? props.discs.paginate : null; if (discs) { return (

Discos

) } else return <> } export const Artist = (props) => { const artist = props.artist; if (artist) { return (

{artist.name}

{[artist.type, artist.country].filter(Boolean).join(' - ')}

) } else { return <> } } export const ArtistView = (props) => { const [artist, setArtist] = useState(null); const [discs, setDiscs] = useState(null); const mbid = props.match.params.mbid; useEffect(() => { if (mbid) { getArtist(mbid).then((result) => setArtist(result)); getArtistDiscs(mbid, 15).then((result) => setDiscs(result)); } }, [mbid]) return (
{!mbid &&

AHH

}
); }