@@ -7,6 +7,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
77import { useRouter , usePathname } from 'next/navigation' ;
88import { useUnsavedChanges } from '@/hooks/useUnsavedChanges' ;
99import { ConfirmDialog } from './ui/confirm-dialog' ;
10+ import Link from 'next/link' ;
1011
1112function HeaderLogo ( ) {
1213 const router = useRouter ( ) ;
@@ -15,12 +16,10 @@ function HeaderLogo() {
1516 const [ showDialog , setShowDialog ] = React . useState ( false ) ;
1617 const handleClick = ( e : React . MouseEvent ) => {
1718 // Only intercept if on /builder
18- if ( pathname . startsWith ( '/builder' ) && hasUnsavedChanges ) {
19+ if ( pathname . includes ( '/builder' ) && hasUnsavedChanges ) {
1920 e . preventDefault ( ) ;
2021 disableUnsavedChanges ( ) ; // Disable browser alerts
2122 setShowDialog ( true ) ;
22- } else {
23- router . push ( '/' ) ;
2423 }
2524 } ;
2625 const handleConfirm = ( ) => {
@@ -29,15 +28,15 @@ function HeaderLogo() {
2928 } ;
3029 return (
3130 < >
32- < button
33- type = 'button '
31+ < Link
32+ href = '/ '
3433 onClick = { handleClick }
3534 className = 'flex items-center gap-2 text-xl font-bold text-foreground hover:text-foreground/80 transition-colors bg-transparent border-none p-0 cursor-pointer'
3635 style = { { background : 'none' , border : 'none' } }
3736 >
3837 < Image src = '/favicon.ico' alt = 'MolViewStories' width = { 24 } height = { 24 } className = 'w-6 h-6' />
3938 MolViewStories
40- </ button >
39+ </ Link >
4140 < ConfirmDialog
4241 open = { showDialog }
4342 onOpenChange = { setShowDialog }
@@ -113,7 +112,6 @@ export function Main({ children, className }: { children: React.ReactNode; class
113112export function PressToSave ( ) {
114113 return (
115114 < div className = 'text-xs text-muted-foreground mb-2' >
116- Press{ ' ' }
117115 < span className = 'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none' >
118116 < span > Ctrl/⌘/Alt + S/Enter</ span >
119117 </ span > { ' ' }
@@ -122,6 +120,17 @@ export function PressToSave() {
122120 ) ;
123121}
124122
123+ export function PressToCodeComplete ( ) {
124+ return (
125+ < div className = 'text-xs text-muted-foreground mb-2' >
126+ < span className = 'bg-muted text-muted-foreground pointer-events-none inline-flex h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none' >
127+ < span > Ctrl + Space</ span >
128+ </ span > { ' ' }
129+ for code completion
130+ </ div >
131+ ) ;
132+ }
133+
125134export function TooltipWrapper ( {
126135 children,
127136 tooltip,
0 commit comments