import React, { useMemo } from 'react'; import { Card, Affix } from 'antd'; import classNames from '@pansy/classnames'; import { CardProps } from 'antd/es/card'; import styles from './index.less'; import { AffixProps } from 'antd/lib/affix'; export interface CardWithFooterProps extends CardProps { footerStyle?: React.CSSProperties; footerTitle?: string | React.ReactNode; footerExtra?: string | React.ReactNode; isAffix?: boolean; affixProps?: AffixProps; } const CardWithFooter: React.FC = props => { const { className, footerStyle, title, footerTitle, footerExtra, children, isAffix = false, affixProps, ...rest } = props; return (
{children} {isAffix ? (footerTitle || footerExtra) && (
{footerTitle}
{footerExtra}
) : (footerTitle || footerExtra) && (
{footerTitle}
{footerExtra}
)}
); }; export default CardWithFooter;