@@ -2,7 +2,7 @@ import { memo } from 'react'
22import { format } from 'date-fns'
33
44import { Note } from '@gitmono/types'
5- import { GlobeIcon , HighlightedCommandItem , NoteFilledIcon , Tooltip , UIText } from '@gitmono/ui'
5+ import { GlobeIcon , HighlightedCommandItem , LockIcon , NoteFilledIcon , Tooltip , UIText } from '@gitmono/ui'
66import { cn } from '@gitmono/ui/src/utils'
77
88import { NoteOverflowMenu } from '@/components/NoteOverflowMenu'
@@ -41,7 +41,7 @@ export const NoteRow = memo(({ note, display = 'default', hideProject = false, p
4141 const content = (
4242 < div
4343 className = { cn ( 'relative flex items-center gap-3 px-3 py-2.5' , {
44- 'cursor-not-allowed opacity-40 ' : isDisabled
44+ 'cursor-not-allowed opacity-50 ' : isDisabled
4545 } ) }
4646 >
4747 < NoteOverflowMenu type = 'context' note = { note } >
@@ -53,25 +53,36 @@ export const NoteRow = memo(({ note, display = 'default', hideProject = false, p
5353 />
5454 </ NoteOverflowMenu >
5555
56- < div className = 'flex h-11 w-11 items-center justify-center rounded-full bg-blue-50 text-blue-500 dark:bg-blue-900/50' >
57- < NoteFilledIcon size = { 24 } />
56+ < div
57+ className = { cn (
58+ 'flex h-11 w-11 items-center justify-center rounded-full' ,
59+ isDisabled
60+ ? 'bg-gray-100 text-gray-400 dark:bg-gray-800 dark:text-gray-600'
61+ : 'bg-blue-50 text-blue-500 dark:bg-blue-900/50'
62+ ) }
63+ >
64+ { isDisabled ? < LockIcon size = { 24 } strokeWidth = '2' /> : < NoteFilledIcon size = { 24 } /> }
5865 </ div >
5966
6067 < UIText weight = 'font-medium' className = 'break-anywhere line-clamp-1 max-w-lg' >
6168 { note . title || 'Untitled' }
6269 </ UIText >
63-
64- { isDisabled && < span className = 'text-xs text-gray-400' > 🔒</ span > }
6570 </ div >
6671 )
6772
68- return isDisabled ? < Tooltip label = 'You do not have permission to view this document' > { content } </ Tooltip > : content
73+ return isDisabled ? (
74+ < Tooltip label = 'You do not have permission to view this document' side = 'top' align = 'start' >
75+ { content }
76+ </ Tooltip >
77+ ) : (
78+ content
79+ )
6980 }
7081
7182 const content = (
7283 < div
7384 className = { cn ( 'relative flex items-center gap-3 px-3 py-2.5' , {
74- 'cursor-not-allowed opacity-40 ' : isDisabled
85+ 'cursor-not-allowed opacity-50 ' : isDisabled
7586 } ) }
7687 >
7788 < NoteOverflowMenu type = 'context' note = { note } >
@@ -84,7 +95,13 @@ export const NoteRow = memo(({ note, display = 'default', hideProject = false, p
8495 </ NoteOverflowMenu >
8596
8697 < div className = 'flex flex-1 items-center gap-3' >
87- < NotePrivacyIndicator note = { note } />
98+ { isDisabled ? (
99+ < div className = 'flex h-5 w-5 items-center justify-center rounded bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400' >
100+ < LockIcon size = { 14 } strokeWidth = '2.5' />
101+ </ div >
102+ ) : (
103+ < NotePrivacyIndicator note = { note } />
104+ ) }
88105
89106 < ViewerFollowUpTag followUps = { note . follow_ups } />
90107
@@ -97,8 +114,6 @@ export const NoteRow = memo(({ note, display = 'default', hideProject = false, p
97114 { format ( note . created_at , 'MMM d, yyyy' ) }
98115 </ UIText >
99116 ) }
100-
101- { isDisabled && < span className = 'text-xs text-gray-400' > 🔒</ span > }
102117 </ div >
103118
104119 < div className = 'flex items-center gap-1' >
@@ -114,6 +129,12 @@ export const NoteRow = memo(({ note, display = 'default', hideProject = false, p
114129 </ div >
115130 )
116131
117- return isDisabled ? < Tooltip label = 'You do not have permission to view this document' > { content } </ Tooltip > : content
132+ return isDisabled ? (
133+ < Tooltip label = 'You do not have permission to view this document' side = 'top' align = 'start' >
134+ { content }
135+ </ Tooltip >
136+ ) : (
137+ content
138+ )
118139} )
119140NoteRow . displayName = 'NoteRow'
0 commit comments