vkashti / components / ui / Card / Card.tsx
Card.tsx
Raw
import { ReactNode } from 'react';

interface Props {
  title: string;
  description?: string;
  footer?: ReactNode;
  children: ReactNode;
}

export default function Card({ title, description, footer, children }: Props) {
  return (
    <div className="card bg-white shadow-sm">
      <div className="card-body">
        <h3 className="card-title text-xl font-medium">{title}</h3>
        {description && (
          <p className="text-base-content/70">{description}</p>
        )}
        <div className="mt-4">
          {children}
        </div>
      </div>
      {footer && (
        <div className="bg-orange-100 px-6 py-4 rounded-b-xl border-t">
          {footer}
        </div>
      )}
    </div>
  );
}