import { LoadingIndicator } from '@create-figma-plugin/ui'; import { useFigmaContext } from '@ui/context'; import { Stack } from './Stack'; export const ExporterProgress = () => { const { currentNode, totalPages, processedPages, downloading } = useFigmaContext(); const truncateText = (text: string, maxChars: number) => { if (text.length <= maxChars) { return text; } return text.slice(0, maxChars) + '...'; }; return ( {!downloading ? ( <> {processedPages} of {totalPages} pages exported 💪 {currentNode ? ( <>
Currently exporting layer
{'“' + truncateText(currentNode, 35) + '”'} ) : undefined} ) : ( <> Generating Penpot file 🚀
Please wait, this process might take a while... )}
); };