0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/ui-src/components/PenpotExporter.tsx
Jordi Sala Morales 4b711b3526
Refactor context (#139)
* Refactor context

* fix

* fix
2024-06-04 18:02:59 +02:00

19 lines
524 B
TypeScript

import { LoadingIndicator } from '@create-figma-plugin/ui';
import { useFigmaContext } from '@ui/context';
import { ExportForm } from './ExportForm';
import { ExporterProgress } from './ExporterProgress';
import { PluginReload } from './PluginReload';
export const PenpotExporter = () => {
const { loading, needsReload, exporting } = useFigmaContext();
if (loading) return <LoadingIndicator />;
if (exporting) return <ExporterProgress />;
if (needsReload) return <PluginReload />;
return <ExportForm />;
};