UNPKG

@ducor/react

Version:

admin template ui interface

18 lines (17 loc) 414 B
export function getGapClass(key) { var index = 0; if (typeof key === 'number') { index = key; } var gapList = { 0: 'gap-0', 1: 'gap-1', 2: 'gap-2', 3: 'gap-3', 4: 'gap-4', 5: 'gap-5', }; // Ensure gap is between 1 and 5 var validGap = Math.min(Math.max(index, 0), 5); // Clamp gap to the range 1-5 return gapList[validGap]; }