mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-04 13:11:35 +02:00
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)
34 lines
943 B
TypeScript
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>;
|
|
}
|