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

Function handleFormat

website/app/components/preview/CDN.tsx:200–213  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

198 'woff',
199 ]);
200 const handleFormat = (value: string) => {
201 if (!FORMATS.includes(value as (typeof FORMATS)[number])) return;
202 const selectedFormat = value as (typeof FORMATS)[number];
203
204 if (formats.length === 1 && formats.includes(selectedFormat)) return;
205
206 setFormat((prev) => {
207 if (prev.includes(selectedFormat)) {
208 return prev.filter((item) => item !== selectedFormat);
209 }
210
211 return [...prev, selectedFormat];
212 });
213 };
214
215 const css = buildStaticPreviewCSS(metadata, {
216 subsets,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected