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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

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>