import Button from '../button'; import ConfigProvider from '../config-provider'; import Icon from '../icon'; import React, { Component } from 'react'; import cls from 'classnames'; import { Card as NextCard } from '@alifd/next'; import { CardActionsProps as NextCardActionsProps, CardMediaProps as NextCardMediaProps, CardProps as NextCardProps, } from '@alifd/next/types/card'; interface CardProps extends NextCardProps { direction?: 'horizontal' | 'vertical'; } interface CardMediaProps extends NextCardMediaProps { fullMedia?: boolean; } interface CardActionsProps extends NextCardActionsProps { btnActions?: boolean | Array; onOk?: (event: React.MouseEvent) => void; onCancel?: (event: React.MouseEvent) => void; okProps?: any; cancelProps?: any; socialActions?: boolean; onTags?: (event: React.MouseEvent) => void; onLike?: (event: React.MouseEvent) => void; onShare?: (event: React.MouseEvent) => void; } class BdesignCardMedia extends Component { render() { const { prefix = 'next-', fullMedia, className } = this.props; return ( ); } } class BdesignCardActions extends Component { render() { const { prefix = 'next-', className, children, btnActions, onOk, onCancel, okProps, cancelProps, socialActions, onTags, onLike, onShare, } = this.props; if (btnActions) { return ( ); } else if (socialActions) { return (
); } return ( {children ? children : undefined} ); } } class Card extends Component { static BulletHeader = NextCard.BulletHeader; static CollaspeContent = NextCard.CollaspeContent; static Header = NextCard.Header; static Content = NextCard.Content; static Media = ConfigProvider.config(BdesignCardMedia); static Actions = ConfigProvider.config(BdesignCardActions); static Divider = NextCard.Divider; render() { const { prefix = 'next-', className, direction } = this.props; return ( ); } } export default ConfigProvider.config(Card);