fix: disable button if messageContent is empty (#137)

This commit is contained in:
Danil Shishkevich
2023-03-25 20:11:27 +07:00
committed by GitHub
parent a005323964
commit d7fdcd0dfe
+2 -1
View File
@@ -84,8 +84,9 @@ export const ChatMessage: FC<Props> = ({ message, messageIndex, lightMode, onEdi
<div className="flex mt-10 justify-center space-x-4">
<button
className="h-[40px] bg-blue-500 text-white rounded-md px-4 py-1 text-sm font-medium hover:bg-blue-600"
className="h-[40px] bg-blue-500 text-white rounded-md px-4 py-1 text-sm font-medium enabled:hover:bg-blue-600 disabled:opacity-50"
onClick={handleEditMessage}
disabled={messageContent.trim().length <= 0}
>
Save & Submit
</button>