// Component import Group from './Group'; // Data fetching import useSwr from 'swr' const fetcher = (url) => fetch(url).then((res) => res.json()) function App (props) { const uuid = props; const { data, error } = useSwr( uuid.uuid ? `https://api.ashcon.app/mojang/v2/user/${uuid.uuid}` : null, fetcher ) if (error) { return ( <>エラーが発生しました。> ) } else { if (!data) { return ( <>読み込み中...> ) } else { return ( <>
{data.username}