import * as React from "react"; import { BodyTypographyBase } from "../base-components"; import { BodyTypography } from "../BodyTypography"; import { PolymorphicWithRef } from "../types"; type CardSupportingTextProps = PolymorphicWithRef< T, { renderText?: ( Text: typeof BodyTypography, props: React.ComponentProps ) => React.ReactElement; } >; type CardSupportingTextElement = ( props: CardSupportingTextProps ) => React.ReactElement>; const CardSupportingText: CardSupportingTextElement = React.forwardRef( ( props: CardSupportingTextProps, innerRef: typeof props.ref ) => { const { component, renderText, ...rest } = props; if (renderText) { return ( {renderText && renderText(BodyTypography, { variant: "body1", size: "medium", supportingText: true, })} ); } else { return ( ); } } ); export default CardSupportingText;