@@ -8,6 +8,7 @@ import { isBuilding } from '../app/env';
8
8
import { PreviewContext } from '../contexts/preview' ;
9
9
import { cn } from '../utils' ;
10
10
import { IconArrowDown } from './icons/icon-arrow-down' ;
11
+ import { IconCheck } from './icons/icon-check' ;
11
12
import { IconInfo } from './icons/icon-info' ;
12
13
import { IconReload } from './icons/icon-reload' ;
13
14
import { Compatibility , useCompatibility } from './toolbar/compatibility' ;
@@ -215,26 +216,50 @@ const ToolbarInner = ({
215
216
< div className = "animate-pulse text-slate-11 text-sm pt-1" >
216
217
Running linting...
217
218
</ div >
219
+ ) : lintingRows ?. length === 0 ? (
220
+ < div className = "flex flex-col items-center justify-center pt-8" >
221
+ < SuccessIcon />
222
+ < SuccessTitle > All good</ SuccessTitle >
223
+ < SuccessDescription >
224
+ No linting issues found.
225
+ </ SuccessDescription >
226
+ </ div >
218
227
) : (
219
- < Linter rows = { lintingRows } />
228
+ < Linter rows = { lintingRows ?? [ ] } />
220
229
) }
221
230
</ Tabs . Content >
222
- < Tabs . Content value = "spam-assassin " >
223
- { spamLoading ? (
231
+ < Tabs . Content value = "compatibility " >
232
+ { compatibilityLoading ? (
224
233
< div className = "animate-pulse text-slate-11 text-sm pt-1" >
225
- Running spam check...
234
+ Running compatibility check...
235
+ </ div >
236
+ ) : compatibilityCheckingResults ?. length === 0 ? (
237
+ < div className = "flex flex-col items-center justify-center py-8 px-4 my-4" >
238
+ < SuccessIcon />
239
+ < SuccessTitle > Great compatibility</ SuccessTitle >
240
+ < SuccessDescription >
241
+ It should render properly everywhere.
242
+ </ SuccessDescription >
226
243
</ div >
227
244
) : (
228
- < SpamAssassin result = { spamCheckingResult } />
245
+ < Compatibility results = { compatibilityCheckingResults ?? [ ] } />
229
246
) }
230
247
</ Tabs . Content >
231
- < Tabs . Content value = "compatibility " >
232
- { compatibilityLoading ? (
248
+ < Tabs . Content value = "spam-assassin " >
249
+ { spamLoading ? (
233
250
< div className = "animate-pulse text-slate-11 text-sm pt-1" >
234
- Running compatibility check...
251
+ Running spam check...
252
+ </ div >
253
+ ) : spamCheckingResult ?. isSpam === false ? (
254
+ < div className = "flex flex-col items-center justify-center py-4 px-4 my-4" >
255
+ < SuccessIcon />
256
+ < SuccessTitle > 10/10</ SuccessTitle >
257
+ < SuccessDescription >
258
+ Your email is clean of abuse indicators.
259
+ </ SuccessDescription >
235
260
</ div >
236
261
) : (
237
- < Compatibility results = { compatibilityCheckingResults } />
262
+ < SpamAssassin result = { spamCheckingResult } />
238
263
) }
239
264
</ Tabs . Content >
240
265
</ div >
@@ -244,6 +269,32 @@ const ToolbarInner = ({
244
269
) ;
245
270
} ;
246
271
272
+ const SuccessIcon = ( ) => {
273
+ return (
274
+ < div className = "relative mb-8 flex items-center justify-center" >
275
+ < div className = "h-16 w-16 rounded-full bg-gradient-to-br from-green-300/20 opacity-80 to-emerald-500/30 blur-md absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2" />
276
+ < div className = "h-12 w-12 rounded-full bg-gradient-to-br from-green-400/80 opacity-10 to-emerald-600/80 absolute m-auto left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-lg" />
277
+ < div className = "h-10 w-10 rounded-full bg-gradient-to-br from-green-400 to-emerald-600 flex items-center justify-center absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 shadow-[inset_0_1px_1px_rgba(255,255,255,0.4)]" >
278
+ < IconCheck size = { 24 } className = "text-white drop-shadow-sm" />
279
+ </ div >
280
+ </ div >
281
+ ) ;
282
+ } ;
283
+
284
+ const SuccessTitle = ( { children } ) => {
285
+ return (
286
+ < h3 className = "text-slate-12 font-medium text-base mb-1" > { children } </ h3 >
287
+ ) ;
288
+ } ;
289
+
290
+ const SuccessDescription = ( { children } ) => {
291
+ return (
292
+ < p className = "text-slate-11 text-sm text-center max-w-[300px]" >
293
+ { children }
294
+ </ p >
295
+ ) ;
296
+ } ;
297
+
247
298
interface ToolbarProps {
248
299
serverSpamCheckingResult : SpamCheckingResult | undefined ;
249
300
serverLintingRows : LintingRow [ ] | undefined ;
0 commit comments