Files
bambuddy/frontend/src/components/Card.tsx
T
maziggy e2b2877965 Archive improvements: list view actions, object count, cross-view highlighting
Added:
  - Archive list view: edit/delete buttons and context menu with full feature parity
  - Archive object count display on cards (extracted from 3MF metadata)
  - Cross-view archive highlighting: click in calendar/project to highlight in card view
  - Context menu button (⋮) on cards and list rows for easy access
  - Spoolman: clear location when spools are removed from AMS

  Fixed:
  - QR code endpoint 500 error (added qrcode[pil] dependency)
2026-01-09 08:24:14 +01:00

34 lines
943 B
TypeScript

import type { ReactNode, MouseEvent, HTMLAttributes } from 'react';
interface CardProps extends HTMLAttributes<HTMLDivElement> {
children: ReactNode;
className?: string;
onClick?: (e: MouseEvent) => void;
onContextMenu?: (e: MouseEvent) => void;
}
export function Card({ children, className = '', onClick, onContextMenu, ...rest }: CardProps) {
return (
<div
className={`bg-bambu-dark-secondary rounded-xl border border-bambu-dark-tertiary card-shadow ${className}`}
onClick={onClick}
onContextMenu={onContextMenu}
{...rest}
>
{children}
</div>
);
}
export function CardHeader({ children, className = '' }: CardProps) {
return (
<div className={`px-6 py-4 border-b border-bambu-dark-tertiary ${className}`}>
{children}
</div>
);
}
export function CardContent({ children, className = '' }: CardProps) {
return <div className={`p-6 ${className}`}>{children}</div>;
}