'use client'; import { useState } from 'react'; import { WhyMyRatingLogo, PreviewScaler } from '@/components'; export function CTATemplateSquare() { const [hook, setHook] = useState('Still reading reviews one by one?'); const [valueProp, setValueProp] = useState('Get AI-powered insights in 45 seconds'); const [ctaText, setCtaText] = useState('Try it free at whyrating.com'); const [isDownloading, setIsDownloading] = useState(false); const downloadPng = async () => { setIsDownloading(true); try { const response = await fetch('/api/screenshot', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ template: 'cta-square', params: { hook, valueProp, ctaText } }), }); if (!response.ok) throw new Error('Screenshot failed'); const blob = await response.blob(); const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.download = `whyrating-cta-square-${Date.now()}.png`; link.href = url; link.click(); URL.revokeObjectURL(url); } catch (error) { console.error('Download failed:', error); alert('Download failed. Please try again.'); } finally { setIsDownloading(false); } }; return (

CTA Post (Square)

1080 × 1080px • Instagram, Facebook

{/* Preview */}
{/* Decorative stars */}
{/* Hook */}
{hook}
{/* Value Prop */}
{valueProp}
{/* CTA */}
{ctaText}
{/* Editor */}