2021-09-25 21:51:35 +09:00
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
import axios from 'axios';
|
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
|
|
|
|
function App (props) {
|
|
|
|
const uuid = props;
|
|
|
|
const [data, setData] = useState({ hits: [] });
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
const fetchData = async () => {
|
|
|
|
const result = await axios(
|
|
|
|
'https://minecraft.yude.jp/group/' + uuid.uuid,
|
|
|
|
);
|
|
|
|
setData(result.data);
|
|
|
|
};
|
|
|
|
fetchData();
|
|
|
|
}, []);
|
2021-09-26 12:52:37 +09:00
|
|
|
|
|
|
|
if (data === undefined || data === null){
|
2021-09-25 21:51:35 +09:00
|
|
|
return <p></p>
|
|
|
|
}else {
|
|
|
|
if (data.toString() == "staff") {
|
2021-09-25 21:53:57 +09:00
|
|
|
return <span className="inline-flex items-center justify-center px-3 py-2 text-base font-bold leading-none text-indigo-100 bg-indigo-700 rounded ml-3">Staff</span>
|
2021-09-25 21:51:35 +09:00
|
|
|
} else {
|
|
|
|
return <></>
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|