import { Box, Image, Inline, Link, Skeleton, Stack, StyleProp, Text, } from "@front10/base-elements"; import * as React from "react"; import { InstagramCardProps } from "./InstagramCard"; import { InstagramVerifiedBadge } from "./InstagramVerifiedBadge"; import InstagramCardInstagramIcon from "./InstagramCardInstagramIcon"; interface Props { profilePicture?: string; profileUrl?: string; username?: string; objectFit: InstagramCardProps["imageCover"]; isLoading?: boolean; userVerified?: boolean; date?: string; showBrandIcon?: boolean; variant?: "inline" | "block"; sx?: StyleProp; } function Avatar( props: Pick< Props, "profileUrl" | "objectFit" | "profilePicture" | "isLoading" | "variant" > ) { const image = ( ); if (props.variant === "block") { return props.isLoading ? (
) : ( image ); } return ( {image} ); } export function InstagramHeader(props: Props) { const avatar = ( ); const headerText = ( {props.isLoading ? ( <> ) : ( <> {props.username} {props.userVerified ? : null} {props.date} )} ); if (props.variant === "block") { return ( {avatar} {headerText} ); } return ( {avatar} {headerText} {props.showBrandIcon ? ( ) : null} ); }