import React from "react"; import { Button } from "../../button"; import { FullImageCardProps } from "./types"; import { Link } from "@shared/components/link"; import { NextImage } from "@shared/components/next-image"; import { Text } from "@shared/components/text"; import { cx } from "@shared/utils"; export const FullImageCard: React.FC = ({ card, lgWidth, mdWidth, }) => { const { anchorId = "FullImageCard", title, description, caption, image, cta, link, className, contentClassName, imageClassName, shadow = true, } = card; const target = cta || link; const href = target?.href; const renderImage = () => { if (!image?.href) return null; const img = ( ); return href ? ( {img} ) : ( img ); }; const titleNode = title ? ( {title} ) : null; return (
{image?.href ? (
{renderImage()}
) : null}
{href && titleNode ? ( {titleNode} ) : ( titleNode )} {description ? ( {description} ) : null}
{caption ? ( {caption} ) : null}
{cta ? (
) : null}
); }; export default FullImageCard;