0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-03 05:10:13 -05:00
penpot-exporter-figma-plugin/ui-src/components/MissingFontsSection.tsx
Alex Sánchez b44cbf2052
Remove custom fonts form (#243)
* remove custom fonts form

* changeset

* changeset
2024-12-20 08:03:23 +01:00

32 lines
965 B
TypeScript

import { Banner, IconInfo32, Link } from '@create-figma-plugin/ui';
import { useFigmaContext } from '@ui/context';
import { Stack } from './Stack';
export const MissingFontsSection = () => {
const { missingFonts } = useFigmaContext();
if (!missingFonts || !missingFonts.length) return null;
return (
<Stack space="small">
<Stack space="xsmall">
<Banner icon={<IconInfo32 />}>
{missingFonts.length} custom font{missingFonts.length > 1 ? 's' : ''} detected:
<ul style={{ paddingLeft: 20 }}>
{missingFonts.map(font => (
<li key={font}>{font}</li>
))}
</ul>
</Banner>
<span>
To export your file with custom fonts, first upload them in Penpot.{' '}
<Link href="https://help.penpot.app/user-guide/custom-fonts/" target="_blank">
Learn how to upload fonts.
</Link>
</span>
</Stack>
</Stack>
);
};