import React, { useState, useEffect } from "react";
import './App.css';
class Card extends React.Component{
state = {
data: {}
}
constructor(props) {
super(props);
this.state.data = props;
}
render() {
return (
{this.state.data.Username}
);
}
}
function CardImg(data) {
return (
Pend: {data.Username}
)
}
/*
function UserDetail(userID, verification) {
const [data, setData] = useState([]);
useEffect(() => {
fetch(
`https://thanos.nightmare.haus/api/user?userID=${userID}`
)
.then(res => res.json())
.then(response => {
setData(response);
})
.catch(error => console.log(error));
});
return (
{data.Nick}
{data.joined_at}
{data.user.id}
)
}
*/
class Pending extends React.Component {
state = {
pending: []
}
componentDidMount() {
const apiUrl = 'https://thanos.nightmare.haus/api/pending';
fetch(apiUrl)
.then((response) => response.json())
.then((data) => this.setState({pending: Object.values(data)}));
}
render() {
return (
{this.state.pending.map((data, i) => (
-
))}
);
}
}
class Verification extends React.Component {
state = {
verifications: []
}
componentDidMount() {
const apiUrl = 'https://thanos.nightmare.haus/api/verifications';
fetch(apiUrl)
.then((response) => response.json())
.then((data) => this.setState({verifications: data}));
}
render() {
return (
{this.state.verifications.map((data, i) => (
-
))}
);
}
}
export {
Pending,
Verification,
}
export default Verification;