import React from "react"; import { css } from "emotion"; import { Box, Flex, IconButton, Image, Skeleton, Tooltip, useTheme, } from "@chakra-ui/core"; import "./ItemList.css"; export function ItemListContainer({ children }) { return {children}; } export function ItemListSkeleton({ count }) { return ( {Array.from({ length: count }).map((_, i) => ( ))} ); } export function Item({ item, itemNameId, outfitState, dispatchToOutfit }) { const { allItemIds } = outfitState; const isInOutfit = allItemIds.includes(item.id); const theme = useTheme(); return ( {item.name} {isInOutfit && ( { dispatchToOutfit({ type: "removeItem", itemId: item.id }); e.preventDefault(); }} opacity="0" transitionProperty="opacity color" transitionDuration="0.2s" className={css` &:hover, &:focus, input:focus + .item-container & { opacity: 1; color: ${theme.colors.gray["800"]}; backgroundcolor: ${theme.colors.gray["200"]}; } `} /> )} ); } function ItemSkeleton() { return ( ); } function ItemContainer({ children }) { const theme = useTheme(); return ( {children} ); } function ItemThumbnail({ src }) { const theme = useTheme(); return ( ); } function ItemName({ children, ...props }) { const theme = useTheme(); return ( {children} ); }