@@ -21,6 +21,8 @@ import { SidebarTrigger } from '@/components/ui/sidebar';
2121import type { SaveState } from '@/lib/editor/save-plugin' ;
2222import type { User } from '@/lib/auth' ;
2323import { PublishSettingsMenu } from '@/components/publish-settings-menu' ;
24+ import { Card , CardHeader , CardContent } from '@/components/ui/card' ;
25+ import { Skeleton } from '@/components/ui/skeleton' ;
2426
2527const Editor = dynamic ( ( ) => import ( '@/components/document/text-editor' ) . then ( mod => mod . Editor ) , {
2628 ssr : false ,
@@ -311,40 +313,50 @@ export function AlwaysVisibleArtifact({
311313 if ( showCreateDocumentForId ) {
312314 return (
313315 < div className = "flex flex-col h-dvh bg-background" >
314- < div className = "flex flex-row justify-between items-center border-b px-3 h-[45px]" >
315- < div className = "flex flex-row gap-2 items-center min-w-0" >
316- < SidebarTrigger />
317- < div className = "font-medium truncate h-6 leading-6 px-1" > Document Not Found</ div >
318- </ div >
319- </ div >
320- < div className = "flex flex-col justify-center items-center h-full gap-4 text-muted-foreground" >
321- < FileText className = "size-16 opacity-50" />
322- < div className = "text-center" >
323- < h3 className = "text-lg font-medium mb-1" > Create New Document?</ h3 >
324- < p className = "text-sm mb-1" > Document ID < code className = "text-xs bg-muted p-1 rounded" > { showCreateDocumentForId } </ code > not found.</ p >
325- < p className = "text-sm mb-4" > Would you like to create it?</ p >
316+ < div className = "flex justify-between items-center border-b px-3 h-[45px]" >
317+ < SidebarTrigger />
318+ </ div >
319+
320+ < div className = "flex flex-col items-center justify-center h-full gap-8 px-4 text-muted-foreground" >
321+ { /* Mini preview card */ }
322+ < Card className = "w-44 h-32 sm:w-52 sm:h-36 md:w-56 md:h-40 border border-border shadow-sm overflow-hidden bg-background" >
323+ < div className = "h-5 bg-muted flex items-center px-2 text-[9px] text-muted-foreground/80 font-mono gap-1" >
324+ < Skeleton className = "h-2.5 w-3/5" />
326325 </ div >
327- < div className = "flex gap-3" >
328- < Button
329- onClick = { ( ) => handleCreateDocumentWithId ( showCreateDocumentForId ) }
330- variant = "default"
331- className = "gap-2"
332- disabled = { isCreatingDocument }
333- >
334- { isCreatingDocument ?
335- < Loader2 className = "h-4 w-4 animate-spin" /> :
336- < PlusIcon className = "h-4 w-4" /> }
337- Create Document
338- </ Button >
339- < Button
340- variant = "outline"
341- className = "gap-2"
342- onClick = { ( ) => router . push ( '/documents' ) }
343- >
344- Cancel
345- </ Button >
326+ < div className = "p-3 space-y-1" >
327+ < Skeleton className = "h-2.5 w-2/3" />
328+ < Skeleton className = "h-2.5 w-full" />
329+ < Skeleton className = "h-2.5 w-5/6" />
346330 </ div >
347- </ div >
331+ </ Card >
332+
333+ { /* Heading + description */ }
334+ < div className = "text-center" >
335+ < h3 className = "text-lg font-medium mb-1 text-foreground " > Document Not Found</ h3 >
336+ < p className = "text-sm" > Create a new document?</ p >
337+ </ div >
338+
339+ { /* Action buttons */ }
340+ < div className = "flex flex-col gap-4 w-full max-w-md" >
341+ < Button
342+ size = "sm"
343+ variant = "default"
344+ className = "w-full"
345+ onClick = { ( ) => handleCreateDocumentWithId ( showCreateDocumentForId ) }
346+ disabled = { isCreatingDocument }
347+ >
348+ { isCreatingDocument ? < Loader2 className = "size-4 animate-spin mx-auto" /> : 'Create Document' }
349+ </ Button >
350+ < Button
351+ variant = "outline"
352+ className = "w-full"
353+ size = "sm"
354+ onClick = { ( ) => router . push ( '/documents' ) }
355+ >
356+ Cancel
357+ </ Button >
358+ </ div >
359+ </ div >
348360 </ div >
349361 ) ;
350362 }
0 commit comments