UNPKG

@elgato/icons

Version:

Icons used throughout the Elgato ecosystem.

25 lines (24 loc) 675 B
import { icons } from "./icons.g.js"; /** * Gets the SVG string metadata for the specified icon. * @param name Name of the icon. * @returns The metadata. */ export function getSvgStringMetadata(name) { const exportName = `icon${name.split("-").reduce((prev, curr) => { return prev + curr.charAt(0).toUpperCase() + curr.substring(1); }, "")}`; return { exportName }; } /** * Gets the React metadata for the specified icon. * @param name Name of the icon. * @returns The metadata. */ export function getReactMetadata(name) { const icon = icons[name]; return { componentName: `Icon${icon.name}`, filename: icon.name, }; }