import React from "react"; import { Skeleton, useTheme, useToken } from "@chakra-ui/react"; import { ClassNames } from "@emotion/react"; import { Link } from "react-router-dom"; import { safeImageUrl, useCommonStyles } from "../util"; function SquareItemCard({ item, ...props }) { const theme = useTheme(); return ( {({ css }) => ( // SquareItemCard renders in large lists of 1k+ items, so we get a big // perf win by using Emotion directly instead of Chakra's styled-system // Box. } /> )} ); } function SquareItemCardLayout({ name, thumbnailImage, minHeightNumLines = 2 }) { const { brightBackground } = useCommonStyles(); const brightBackgroundValue = useToken("colors", brightBackground); const theme = useTheme(); return ( // SquareItemCard renders in large lists of 1k+ items, so we get a big perf // win by using Emotion directly instead of Chakra's styled-system Box. {({ css }) => (
{thumbnailImage}
{name}
)}
); } export function SquareItemCardSkeleton({ minHeightNumLines }) { return ( {minHeightNumLines >= 3 && ( )} } thumbnailImage={} minHeightNumLines={minHeightNumLines} /> ); } export default SquareItemCard;