@@ -90,7 +90,7 @@ const NotificationOptionsButton = ({
9090 } ) ;
9191 } ;
9292
93- const Icon = ( ) : ReactElement => {
93+ const Icon = ( ) : ReactElement | null => {
9494 if ( ! notification ) {
9595 return null ;
9696 }
@@ -109,7 +109,7 @@ const NotificationOptionsButton = ({
109109
110110 const label = useMemo ( ( ) : string => {
111111 if ( ! notification ) {
112- return null ;
112+ return '' ;
113113 }
114114
115115 if ( isFetching ) {
@@ -120,6 +120,10 @@ const NotificationOptionsButton = ({
120120 preferences [ 0 ] ?. status === NotificationPreferenceStatus . Muted ;
121121 const copy = notificationMutingCopy [ notification ?. type ] ;
122122
123+ if ( ! copy ) {
124+ return '' ;
125+ }
126+
123127 return isMuted ? copy . unmute : copy . mute ;
124128 } , [ notification , preferences , isFetching ] ) ;
125129 const options = [ { icon : < Icon /> , label, action : onItemClick } ] ;
@@ -145,7 +149,7 @@ const NotificationOptionsButton = ({
145149 ) ;
146150} ;
147151
148- function NotificationItem ( props : NotificationItemProps ) : ReactElement {
152+ function NotificationItem ( props : NotificationItemProps ) : ReactElement | null {
149153 const {
150154 icon,
151155 type,
@@ -165,7 +169,7 @@ function NotificationItem(props: NotificationItemProps): ReactElement {
165169 isReady,
166170 title : memoizedTitle ,
167171 description : memoizedDescription ,
168- } = useObjectPurify ( { title, description } ) ;
172+ } = useObjectPurify ( { title, description : description ?? '' } ) ;
169173 const router = useRouter ( ) ;
170174 const isClickable = ! notificationTypeNotClickable [ type ] ;
171175
@@ -281,6 +285,7 @@ function NotificationItem(props: NotificationItemProps): ReactElement {
281285 < NotificationItemAttachment
282286 key = { attachment }
283287 title = { attachment }
288+ notificationType = { type }
284289 { ...restAttachmentProps }
285290 />
286291 ) ) }
0 commit comments