@@ -121,7 +121,7 @@ export function WebviewOption({model}: {model: Model}) {
121121 const { GiveDialog, openGiveDialog} = useOpenGiveDialog ( ) ;
122122 const trackDownload = React . useCallback (
123123 ( event : TrackedMouseEvent ) => {
124- trackLink ( event , model . id ) ;
124+ trackLink ( event , model . id . toString ( ) ) ;
125125 } ,
126126 [ model . id ]
127127 ) ;
@@ -140,10 +140,10 @@ export function WebviewOption({model}: {model: Model}) {
140140 < GiveDialog
141141 link = { webviewLink }
142142 variant = "View online"
143- warning = { model . contentWarningText }
143+ warning = { model . contentWarningText ?? undefined }
144144 track = "Online"
145145 onDownload = { trackDownload }
146- id = { model . id }
146+ id = { model . id . toString ( ) }
147147 />
148148 { showCallout && (
149149 < div className = "callout recommended-callout" >
@@ -173,12 +173,12 @@ export function PdfOption({model}: {model: Model}) {
173173 const { GiveDialog, openGiveDialog} = useOpenGiveDialog ( ) ;
174174 const trackDownload = React . useCallback (
175175 ( event : TrackedMouseEvent ) => {
176- trackLink ( event , model . id ) ;
176+ trackLink ( event , model . id . toString ( ) ) ;
177177 } ,
178178 [ model . id ]
179179 ) ;
180180
181- return (
181+ return pdfLink ? (
182182 < React . Fragment >
183183 < SimpleLinkOption
184184 link = { pdfLink }
@@ -190,11 +190,11 @@ export function PdfOption({model}: {model: Model}) {
190190 link = { pdfLink }
191191 track = "PDF"
192192 onDownload = { trackDownload }
193- id = { model . id }
194- warning = { model . contentWarningText }
193+ id = { model . id . toString ( ) }
194+ warning = { model . contentWarningText ?? undefined }
195195 />
196196 </ React . Fragment >
197- ) ;
197+ ) : null ;
198198}
199199
200200export function usePrintCopyDialog ( ) {
@@ -254,8 +254,8 @@ export function KindleOption({model}: {model: Model}) {
254254
255255export function CheggOption ( { model} : { model : Model } ) {
256256 return (
257- < Option condition = { model . cheggLink } >
258- < a href = { model . cheggLink } data-track = "Chegg Reader" >
257+ < Option condition = { model . cheggLink ?? false } >
258+ < a href = { model . cheggLink as string } data-track = "Chegg Reader" >
259259 < img
260260 className = "logo-img"
261261 src = "/dist/images/icons/Chegglogo.svg"
0 commit comments