mirror of
https://github.com/patdelphi/suanming.git
synced 2026-02-28 05:33:11 +08:00
54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
import React, { ReactNode } from 'react';
|
|
import { cn } from '../../lib/utils';
|
|
|
|
interface CardProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export const Card: React.FC<CardProps> = ({ children, className }) => {
|
|
return (
|
|
<div className={cn('bg-white rounded-lg shadow-lg p-6', className)}>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
interface CardHeaderProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export const CardHeader: React.FC<CardHeaderProps> = ({ children, className }) => {
|
|
return (
|
|
<div className={cn('mb-4', className)}>
|
|
{children}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
interface CardTitleProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export const CardTitle: React.FC<CardTitleProps> = ({ children, className }) => {
|
|
return (
|
|
<h3 className={cn('text-xl font-semibold text-gray-900', className)}>
|
|
{children}
|
|
</h3>
|
|
);
|
|
};
|
|
|
|
interface CardContentProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export const CardContent: React.FC<CardContentProps> = ({ children, className }) => {
|
|
return (
|
|
<div className={cn('text-gray-700', className)}>
|
|
{children}
|
|
</div>
|
|
);
|
|
}; |