我是TailWindCSS的新手,我想在一个按钮元素中添加启用/禁用样式。如何有条件地添加禁用特定的样式/类(例如,假设我需要添加"opacity-50 cursor-not-allowed")到按钮上?
<button
className="bg-blue-500 hover:bg-blue-400 text-white font-bold py-2 px-4 border-b-4 border-blue-700 hover:border-blue-500 rounded mr-3"
disabled={!globalContext.users.length > 0}
onClick={handleClearResultsClick}
>
Clear Results
</button>