import { Flex } from 'antd';
import React, { PropsWithChildren } from 'react';
import styles from './index.less';

interface PropsType {
  w?: any;
  h?: any;
  title?: any;
  headerRight?: React.ReactNode;
}

/** @name 基础卡片 */
const BaseCard: React.FC<PropsWithChildren<PropsType>> = (props) => {
  const { w, h, title, children, headerRight } = props;
  return (
    <div className={styles.container} style={{ width: w, height: h }}>
      {title && (
        <Flex justify="space-between" className={styles.title}>
          {title}
          {headerRight}
        </Flex>
      )}
      <div className={styles.content}>{children}</div>
    </div>
  );
};

export default BaseCard;
