import type { IIcon } from "../config/types"; /** * Получает свойства для элемента `svg` * @returns HTMLAttributes */ export const getSvgAttrs = (size: IIcon["size"]): Partial<{ width: number | string; height: number | string; }> => { const getFactor = () => { switch (size) { case "small": return 2; case "medium": return 3; case "large": return 4; case "max": return 5; default: return 0; } }; const remPx = 8; const factor = getFactor(); return { width: factor * remPx, height: factor * remPx, }; };