'use client'; import { forwardRef, HTMLAttributes } from 'react'; export interface DocumentStampProps extends HTMLAttributes { /** Stamp text */ text: string; /** Stamp type */ type?: 'approved' | 'rejected' | 'confidential' | 'draft' | 'custom'; /** Stamp size */ size?: 'small' | 'medium' | 'large'; /** Stamp rotation */ rotation?: number; /** Stamp color */ color?: string; /** Stamp border width */ borderWidth?: number; /** Stamp opacity */ opacity?: number; /** Enable rotation animation */ animated?: boolean; } const typeColors = { approved: '#00aa00', rejected: '#aa0000', confidential: '#aa00aa', draft: '#666666', custom: '#000000', }; const typeBackgrounds = { approved: 'rgba(0, 170, 0, 0.05)', rejected: 'rgba(170, 0, 0, 0.05)', confidential: 'rgba(170, 0, 170, 0.05)', draft: 'rgba(102, 102, 102, 0.05)', custom: 'rgba(0, 0, 0, 0.05)', }; const sizeClasses = { small: 'w-20 h-[50px] text-[0.75rem]', medium: 'w-[120px] h-[70px] text-[0.875rem]', large: 'w-[160px] h-[90px] text-base', }; const borderStyles = { draft: 'border-dashed', approved: 'border-solid', rejected: 'border-solid', confidential: 'border-solid', custom: 'border-solid', }; export const DocumentStamp = forwardRef( ( { text, type = 'approved', size = 'medium', rotation = -15, color, borderWidth = 3, opacity = 0.7, animated = false, className, style, ...props }, ref ) => { const finalColor = color || typeColors[type]; const finalBackground = typeBackgrounds[type]; const borderStyle = borderStyles[type]; return ( {text} {/* Inner border */} {/* Pattern for confidential */} {type === 'confidential' && ( )} {/* X marks for rejected */} {type === 'rejected' && ( <> ✕ ✕ > )} ); } ); DocumentStamp.displayName = 'DocumentStamp'; export default DocumentStamp;