'use client' import { PDFDownloadLink } from '@react-pdf/renderer' import ResultadoPDF from '@/app/components/ResultadoPDF' interface PDFDownloadButtonProps { resultado: any onDownload?: () => void } export default function PDFDownloadButton({ resultado, onDownload }: PDFDownloadButtonProps) { const slug = (resultado?.nome_estetica || 'editorial') .toString() .toLowerCase() .normalize('NFD') .replace(/[̀-ͯ]/g, '') .replace(/[^a-z0-9]+/g, '-') .replace(/^-|-$/g, '') return ( } fileName={`drop-edit-${slug}.pdf`} className="w-full text-center bg-gray-100 text-black border border-gray-200 text-[11px] font-medium tracking-widest uppercase py-4 hover:bg-black hover:text-white hover:border-black transition-colors block" onClick={() => onDownload?.()} > {({ loading }) => (loading ? 'Generating PDF…' : '↓ Download PDF')} ) }