[style] apply review feedback: simplify conditional logic

Simplify conditional class logic in FormSelectButton.vue per review suggestion:
- Combine cursor classes into single ternary
- Combine background classes into nested ternary with !disabled guard
This commit is contained in:
bymyself
2025-11-06 13:05:27 -07:00
parent 6e2b20b5bf
commit cb0861edf5

View File

@@ -15,14 +15,11 @@
'flex-1 h-6 px-5 py-[5px] rounded flex justify-center items-center gap-1 transition-all duration-150 ease-in-out',
'bg-transparent border-none',
'text-center text-xs font-normal',
{
'bg-interface-menu-component-surface-selected':
isSelected(option) && !disabled,
'hover:bg-interface-menu-component-surface-hovered':
!isSelected(option) && !disabled,
'opacity-50 cursor-not-allowed': disabled,
'cursor-pointer': !disabled
},
disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer',
!disabled &&
(isSelected(option)
? 'bg-interface-menu-component-surface-selected'
: 'hover:bg-interface-menu-component-surface-hovered'),
isSelected(option) && !disabled ? 'text-primary' : 'text-secondary'
)
"