MCPcopy Create free account
hub / github.com/fontsource/fontsource / handleFormat

Function handleFormat

website/app/components/preview/InstallCode.tsx:340–353  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

338 'woff',
339 ]);
340 const handleFormat = (value: string) => {
341 if (!FORMATS.includes(value as (typeof FORMATS)[number])) return;
342 const selectedFormat = value as (typeof FORMATS)[number];
343
344 if (formats.length === 1 && formats.includes(selectedFormat)) return;
345
346 setFormat((prev) => {
347 if (prev.includes(selectedFormat)) {
348 return prev.filter((item) => item !== selectedFormat);
349 }
350
351 return [...prev, selectedFormat];
352 });
353 };
354
355 const css = buildStaticPreviewCSS(metadata, {
356 subsets,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected