Card.tsx 863 B

1234567891011121314151617181920212223242526272829303132
  1. import type { ReactNode, MouseEvent } from 'react';
  2. interface CardProps {
  3. children: ReactNode;
  4. className?: string;
  5. onClick?: (e: MouseEvent) => void;
  6. onContextMenu?: (e: MouseEvent) => void;
  7. }
  8. export function Card({ children, className = '', onClick, onContextMenu }: CardProps) {
  9. return (
  10. <div
  11. className={`bg-bambu-dark-secondary rounded-xl border border-bambu-dark-tertiary card-shadow ${className}`}
  12. onClick={onClick}
  13. onContextMenu={onContextMenu}
  14. >
  15. {children}
  16. </div>
  17. );
  18. }
  19. export function CardHeader({ children, className = '' }: CardProps) {
  20. return (
  21. <div className={`px-6 py-4 border-b border-bambu-dark-tertiary ${className}`}>
  22. {children}
  23. </div>
  24. );
  25. }
  26. export function CardContent({ children, className = '' }: CardProps) {
  27. return <div className={`p-6 ${className}`}>{children}</div>;
  28. }