2024-12-20 02:03:23 -05:00
|
|
|
import { Banner, IconInfo32, Link } from '@create-figma-plugin/ui';
|
2024-05-09 05:56:45 -05:00
|
|
|
|
2024-06-04 11:02:59 -05:00
|
|
|
import { useFigmaContext } from '@ui/context';
|
2024-06-04 08:33:55 -05:00
|
|
|
|
2024-05-09 05:56:45 -05:00
|
|
|
import { Stack } from './Stack';
|
2024-05-03 06:43:07 -05:00
|
|
|
|
2024-06-04 08:33:55 -05:00
|
|
|
export const MissingFontsSection = () => {
|
2024-06-04 11:02:59 -05:00
|
|
|
const { missingFonts } = useFigmaContext();
|
2024-05-03 06:43:07 -05:00
|
|
|
|
2024-06-04 08:33:55 -05:00
|
|
|
if (!missingFonts || !missingFonts.length) return null;
|
2024-05-09 05:56:45 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Stack space="small">
|
|
|
|
<Stack space="xsmall">
|
|
|
|
<Banner icon={<IconInfo32 />}>
|
2024-12-20 02:03:23 -05:00
|
|
|
{missingFonts.length} custom font{missingFonts.length > 1 ? 's' : ''} detected:
|
|
|
|
<ul style={{ paddingLeft: 20 }}>
|
|
|
|
{missingFonts.map(font => (
|
|
|
|
<li key={font}>{font}</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
2024-05-09 05:56:45 -05:00
|
|
|
</Banner>
|
2024-12-20 02:03:23 -05:00
|
|
|
<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>
|
2024-05-09 05:56:45 -05:00
|
|
|
</Stack>
|
|
|
|
</Stack>
|
|
|
|
);
|
|
|
|
};
|