129129 </ div >
130130 < div id ="result "
131131 class ="p-4 border rounded-md min-h-[100px] bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600 transition-colors duration-200 "> </ div >
132+ < button id ="show-all-errors " class ="mt-4 px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded-md focus:outline-none focus:ring-2 focus:ring-gray-500 transition-colors duration-200 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed "> < svg class ="w-4 h-4 " fill ="none " stroke ="currentColor " viewBox ="0 0 24 24 "> < path stroke-linecap ="round " stroke-linejoin ="round " stroke-width ="2 " d ="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z "> </ path > </ svg > Show All Errors</ button >
132133 < div id ="history " class ="mt-4 space-y-2 ">
133134 < h3 class ="text-lg font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2 ">
134135 < svg class ="w-5 h-5 " fill ="none " stroke ="currentColor " viewBox ="0 0 24 24 ">
@@ -138,12 +139,6 @@ <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100 flex items-cen
138139 Recent Corrections
139140 </ h3 >
140141 < div id ="history-list " class ="space-y-2 "> </ div >
141- < button id ="show-all-errors " class ="mt-4 px-4 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded-md focus:outline-none focus:ring-2 focus:ring-gray-500 transition-colors duration-200 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed ">
142- < svg class ="w-4 h-4 " fill ="none " stroke ="currentColor " viewBox ="0 0 24 24 ">
143- < path stroke-linecap ="round " stroke-linejoin ="round " stroke-width ="2 " d ="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z "> </ path >
144- </ svg >
145- Show All Errors
146- </ button >
147142 </ div >
148143 < div id ="error-modal " class ="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50 ">
149144 < div class ="bg-white dark:bg-gray-800 rounded-lg max-w-2xl w-full mx-4 max-h-[90vh] flex flex-col ">
@@ -251,6 +246,8 @@ <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100">All Detected
251246 console . error ( 'Error:' , error ) ;
252247 resultContainer . textContent = 'An error occurred while checking the text. Please try again.' ;
253248 showNotification ( 'Error checking grammar' , 'error' ) ;
249+ window . errors = grammarData . errors ;
250+ document . getElementById ( 'show-all-errors' ) . disabled = grammarData . errors . length === 0 ;
254251 } finally {
255252 button . disabled = false ;
256253 button . innerHTML = '<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg>Check Grammar' ;
0 commit comments