('present')
const isSlides = url ? isFigmaSlidesUrl(url) : false
const embedSrc = url ? toFigmaEmbedUrl(url, { slidesView: view }) : null
const originalUrl = (() => {
if (!url) return null
try {
const parsed = new URL(toFigmaOriginalUrl(url))
const host = parsed.hostname.toLowerCase()
const okHost = host === 'figma.com' || host.endsWith('.figma.com')
const okProtocol = parsed.protocol === 'https:' || parsed.protocol === 'http:'
return okHost && okProtocol ? parsed.toString() : null
} catch {
return null
}
})()
const heading = title || 'Figma Design'
return (
}
title={heading}
titleVariant="h6"
actions={
{isSlides && embedSrc && }
{originalUrl && (
}
rightIcon={}
className="w-full sm:w-auto"
>
Open in Figma
)}
}
src={embedSrc}
allow="clipboard-write; clipboard-read; fullscreen"
loading={loading}
height={height}
allowFullScreen
emptyIcon={}
emptyMessage="Figma URL not configured"
/>
)
}