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/ExportForm.tsx
Alex Sánchez 570aeee7b0
Minor updates (#239)
* minor updates

* lint fixes

* changeset
2024-12-04 08:06:58 +01:00

30 lines
880 B
TypeScript

import { Button } from '@create-figma-plugin/ui';
import { FormProvider, useForm } from 'react-hook-form';
import { Stack } from '@ui/components/Stack';
import { useFigmaContext } from '@ui/context';
import { MissingFontsSection } from './MissingFontsSection';
export type FormValues = Record<string, string>;
export const ExportForm = () => {
const { cancel, exportPenpot } = useFigmaContext();
const methods = useForm<FormValues>();
return (
<FormProvider {...methods}>
<form onSubmit={methods.handleSubmit(exportPenpot)}>
<Stack>
<MissingFontsSection />
<Stack space="xsmall" direction="row">
<Button fullWidth>Export to Penpot</Button>
<Button secondary onClick={cancel} fullWidth>
Cancel
</Button>
</Stack>
</Stack>
</form>
</FormProvider>
);
};