/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import React from "react"; import Link from "../components/Link"; import Utils from "../services/UtilsService"; interface CardGroupProps { children: React.ReactNode; } function CardGroup(props: CardGroupProps) { return ( ); } interface CardProps { id: string; title: string; col: number; children: React.ReactNode; link?: string; } function Card(props: CardProps) { return (
  • {props.link ? {props.title} : props.title}

    {React.Children.map(props.children, (child) => { if ((child as React.ReactElement).type === CardBody) { return child; } })} {React.Children.map(props.children, (child) => { if ((child as React.ReactElement).type === CardFooter) { return child; } })}
  • ); } interface CardBodyProps { children: React.ReactNode; } function CardBody(props: CardBodyProps) { return
    {props.children}
    ; } interface CardFooterProps { children: React.ReactNode; } function CardFooter(props: CardFooterProps) { return
    {props.children}
    ; } CardGroup.CardFooter = CardFooter; CardGroup.CardBody = CardBody; CardGroup.Card = Card; export default CardGroup;