import React, { useState, useEffect } from "react";

import { Redirect } from "react-router-dom";

import { Button, Spin } from 'antd';
import { CheckCircleOutlined } from '@ant-design/icons';

import _auth from '@netuno/auth-client';

import _service from '@netuno/service-client';

export default ({ data }) => {
    const servicesPrefix = _service.config().prefix; 
    return (
        <li style={{backgroundImage: `url(${servicesPrefix}api/communities/image?uid=${data.uid})`}}>
            <h1>
                { data.name }
                &nbsp;
                { data.following ? <CheckCircleOutlined /> : null }
            </h1>
        </li>
    );
};
