{"size": 1214, "ext": "js", "max_stars_repo_path": "Website/ClientApp/src/components/dashbaords/Guild.js", "max_stars_repo_name": "ta1H3n/Namiko", "max_stars_repo_stars_event_min_datetime": "2018-12-04T07:16:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-11T00:32:17.000Z", "max_issues_repo_path": "Website/ClientApp/src/components/dashbaords/Guild.js", "max_issues_repo_name": "ta1H3n/Namiko", "max_issues_repo_issues_event_min_datetime": "2020-10-12T07:10:53.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-02T16:22:13.000Z", "max_forks_repo_path": "Website/ClientApp/src/components/dashbaords/Guild.js", "max_forks_repo_name": "ta1H3n/Namiko", "max_forks_repo_forks_event_min_datetime": "2019-11-18T16:55:36.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-01T10:10:37.000Z"}
{"max_stars_count": 7, "max_issues_count": 60, "max_forks_count": 4, "avg_line_length": 28.2325581395, "max_line_length": 98, "alphanum_fraction": 0.5255354201}
﻿import React, { Component } from 'react';
import { Container } from 'reactstrap';
import { get } from '../RequestHandler';

export class Guild extends Component {
    static displayName = Guild.name;

    constructor(props) {
        super(props);
        this.state = {
            waifus: [],
            loading: true
        };
    }

    componentDidMount() {
        const { guildId } = this.props.match.params;
        this.load(guildId);
    }

    render() {
        let contents = this.state.loading
            ? <h4 className="text-muted text-center align-middle"><em>Loading...</em></h4>
            : this.state.waifus.length === 0
                ? <h4 className="text-muted text-center align-middle"><em>~ Shop empty ~</em></h4>
                : <h4 className="text-muted text-center align-middle"><em>asdf</em></h4>

        return (
            <Container>
                <div>
                    {contents}
                </div>
            </Container>
        );
    }

    async load(guildId) {
        var query = "api/waifushop/" + guildId;
        const response = await get(query);
        const data = response.value;
        this.setState({ waifus: data, loading: false });
    }
}