import React from "react"; import gql from "graphql-tag"; import { useQuery } from "@apollo/react-hooks"; import { Flex, Image, Spinner, Text, Icon, Box } from "@chakra-ui/core"; import { Delay } from "./util"; function OutfitPreview({ itemIds, speciesId, colorId }) { const { loading, error, data } = useQuery( gql` query($itemIds: [ID!]!, $speciesId: ID!, $colorId: ID!) { items(ids: $itemIds) { id appearanceOn(speciesId: $speciesId, colorId: $colorId) { layers { id imageUrl(size: SIZE_600) } } } } `, { variables: { itemIds, speciesId, colorId } } ); if (loading) { return ( ); } if (error) { return ( Could not load preview. Try again? ); } return ( ); } function FullScreenCenter({ children }) { return ( {children} ); } export default OutfitPreview;