import React from 'react'; import superagent from 'superagent'; import { Container, Menu, Segment, Grid, Header, Image, Icon, Button, Form, Label } from 'semantic-ui-react' export default class ChannelTest extends React.Component { constructor(props) { super(props); this.state = { channelGroups: [] }; } async componentDidMount() { try { const res = await superagent.get("/api/media/public_channel_groups"); console.log(res.body); this.setState({ channelGroups: res.body }); } catch (e) { console.log(e); } } render() { return ( {this.state.channelGroups.map((channelGroup, index) => { if (channelGroup.textures && channelGroup.textures.length >= 3) { return (
{channelGroup.name}
); } else { return (
) } })} ); } }