mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-08 16:10:07 -05:00
33 lines
908 B
TypeScript
33 lines
908 B
TypeScript
|
import { Button } from '@create-figma-plugin/ui';
|
||
|
import { FormProvider, useForm } from 'react-hook-form';
|
||
|
|
||
|
import { Stack } from '@ui/components/Stack';
|
||
|
import { useFigma } from '@ui/context';
|
||
|
|
||
|
import { MissingFontsSection } from './MissingFontsSection';
|
||
|
|
||
|
export type FormValues = Record<string, string>;
|
||
|
|
||
|
export const ExportForm = () => {
|
||
|
const { cancel, exportPenpot } = useFigma();
|
||
|
const methods = useForm<FormValues>();
|
||
|
|
||
|
return (
|
||
|
<FormProvider {...methods}>
|
||
|
<form onSubmit={methods.handleSubmit(exportPenpot)}>
|
||
|
<Stack>
|
||
|
<MissingFontsSection />
|
||
|
<Stack space="xsmall" direction="row">
|
||
|
<Button type="submit" fullWidth>
|
||
|
Export to Penpot
|
||
|
</Button>
|
||
|
<Button secondary onClick={cancel} fullWidth>
|
||
|
Cancel
|
||
|
</Button>
|
||
|
</Stack>
|
||
|
</Stack>
|
||
|
</form>
|
||
|
</FormProvider>
|
||
|
);
|
||
|
};
|