import { Card, Link, Stack, useContainerSize } from "@front10/base-elements"; import clsx from "clsx"; import * as React from "react"; import { InstagramCardProps } from "./InstagramCard"; import InstagramCardPostTypeCarouselIcon from "./InstagramCardPostTypeCarouselIcon"; import InstagramCardPostTypeVideoIcon from "./InstagramCardPostTypeVideoIcon"; import { InstagramHeader } from "./InstagramHeader"; import { InstagramImage } from "./InstagramImage"; import { InstagramReactions } from "./InstagramReactions"; import { InstagramText } from "./InstagramText"; function InstagramB( { data: { image, imageAltText = "", //likes count text1, //comment counts text2, //caption text text3, link, type, // profileAvatar text6, // created text7, // profileUserName, text8, imageFull, userVerified, } = {}, showText1 = true, showText2 = true, showText3 = true, imageCover = "cover", onCardClick, onCallToActionClick, tabIndex, className, isLoading, ...props }: InstagramCardProps, ref: React.Ref ) { const cardWidth = useContainerSize(ref as any); return ( ({ ...theme.layout?.cardContainer, minHeight: "fit-content", })} className={clsx("wx-card", className)} > {cardWidth > 150 ? ( 200} /> ) : null} {cardWidth > 180 && type === "video" && ( )} {cardWidth > 180 && type === "carousel" && ( )} {cardWidth > 150 && (isLoading || text1 || text2 || text3) && ( {cardWidth > 190 ? ( 300} /> ) : null} {showText3 ? ( {text3} ) : null} )} ); } const InstagramBWithRef = React.forwardRef(InstagramB); export { InstagramBWithRef as InstagramB };