Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function calculateCardWidth(card) {
// If the card's width is found in the accepted sizes return that class,
// or return the default 1/3 class
return CardSizes.indexOf(card.width) !== -1 ? `w-${card.width}` : 'w-1/3'
}