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

Function generateImports

website/app/components/preview/InstallCode.tsx:79–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 }\n`;
78
79 const generateImports = () => {
80 const activeAxisTags = Object.keys(isActive).filter(
81 (axis) => isActive[axis],
82 );
83 const importSpecifier = getVariableImport(
84 metadata,
85 variable,
86 activeAxisTags,
87 isItal ? 'italic' : 'normal',
88 );
89 return `import '${importSpecifier}';`;
90 };
91
92 const handleActive = (value: string | number) => {
93 setActive((prev) => toggleVariableAxis(prev, value));

Callers 2

VariableSimpleFunction · 0.85
StaticSimpleFunction · 0.85

Calls 1

getVariableImportFunction · 0.90

Tested by

no test coverage detected