import React from 'react';
import Title from 'antd/es/typography/Title';
import Text from 'antd/es/typography/Text';
import Paragraph from 'antd/es/typography/Paragraph';
import { cn } from '@/lib/utils';


type TypographyProps = {
  type?: 'title' | 'paragraph' | 'text';
  level?: 1 | 2 | 3 | 4 | 5 | undefined;
  className?: string;
  children: React.ReactNode;
};

const AppTypography = ({
  type = 'text',
  level,
  children,
  className,
  ...props
}: TypographyProps) => {
  switch (type) {
    case 'title':
      return (
        <Title level={level} className={cn(className)} {...props}>
          {children}
        </Title>
      );
    case 'paragraph':
      return (
        <Paragraph className={cn(className)} {...props}>
          {children}
        </Paragraph>
      );
    case 'text':
    default:
      return (
        <Text className={cn(className)} {...props}>
          {children}
        </Text>
      );
  }
};

export default AppTypography;
