import React from 'react';
import { UserCardProps, InfoType, User } from '../types';
import NameOnlyCard from './name-only';
import BasicCard from './basic-info';

interface DetailedCardProps extends Omit<UserCardProps, 'user'> {
  user: User;
  shouldShowHoverCard: boolean;
  renderCardContent?: () => React.ReactNode | null;
}

// DetailedCard组件，根据infoType选择不同的卡片组件进行渲染
function DetailedCard({ ...props }: DetailedCardProps) {
  const { infoType = InfoType.Minimal } = props;

  // 根据信息类型选择合适的卡片组件
  switch (infoType) {
    case InfoType.NameOnly:
      return <NameOnlyCard {...props} />;
    default:
      return <BasicCard {...props} />;
  }
}

export default DetailedCard;
