teqo-backup/src/components/cards/CardPreviewCanvas.tsx
Francisco Solla 681f3bb566 feat(S13): cards personalizados da campanha no site público
Home ganha a seção Faça parte com os três modelos e a rota /cards
concentra catálogo + compositor client-side (dialog desktop, bottom
drawer mobile): nome no slot medido do mestre com Brexter 700 e foto
full-bleed sob o overlay oficial (pan/zoom clampados), download PNG
sem conta e sem enviar nome/foto. Núcleo puro em src/lib/card* com
unit tests; e2e cobre home→deep-link, nome→PNG real, erro fail-closed,
foto e drawer mobile. Sem migration/PII.
2026-09-12 03:25:43 -03:00

26 lines
669 B
TypeScript

import type { HTMLAttributes, RefObject } from 'react'
/**
* S13 — the canvas element of the card studio. Presentational only: the
* composer owns the ref, the draw effect and the pointer/keyboard controls.
*/
export const CardPreviewCanvas = ({
model,
canvasRef,
className,
...props
}: {
model: { width: number; height: number; label: string }
canvasRef: RefObject<HTMLCanvasElement | null>
className?: string
} & HTMLAttributes<HTMLCanvasElement>) => (
<canvas
ref={canvasRef}
width={model.width}
height={model.height}
role="img"
aria-label={`Prévia do card: ${model.label}`}
className={className}
{...props}
/>
)