mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
0dbd7d00f1
* error management * error message * fixes
22 lines
630 B
TypeScript
22 lines
630 B
TypeScript
import { LoadingIndicator } from '@create-figma-plugin/ui';
|
|
|
|
import { LibraryError } from '@ui/components/LibraryError';
|
|
import { useFigmaContext } from '@ui/context';
|
|
|
|
import { ExportForm } from './ExportForm';
|
|
import { ExporterProgress } from './ExporterProgress';
|
|
import { PluginReload } from './PluginReload';
|
|
|
|
export const PenpotExporter = () => {
|
|
const { loading, needsReload, exporting, error } = useFigmaContext();
|
|
|
|
if (loading) return <LoadingIndicator />;
|
|
|
|
if (exporting) return <ExporterProgress />;
|
|
|
|
if (needsReload) return <PluginReload />;
|
|
|
|
if (error) return <LibraryError />;
|
|
|
|
return <ExportForm />;
|
|
};
|