@@ -271,12 +271,18 @@ export function renderAttachmentFileIcon(options: {
271271 unavailable ?: boolean ;
272272} ) {
273273 const resolved = resolveAttachmentFileIcon ( options . filename , options . mimeType ) ;
274- const compactLight = resolved . compact
275- ? fileIconAssetPath ( `compact/light/${ resolved . compact } ` )
276- : fileIconAssetPath ( "compact/unknown-light" ) ;
277- const compactDark = resolved . compact
278- ? fileIconAssetPath ( `compact/dark/${ resolved . compact } ` )
279- : fileIconAssetPath ( "compact/unknown-dark" ) ;
274+ const large = options . mode === "large-placeholder" ;
275+ const size = large ? "44px" : "20px" ;
276+ const light = large
277+ ? fileIconAssetPath ( "large/shell-light" )
278+ : resolved . compact
279+ ? fileIconAssetPath ( `compact/light/${ resolved . compact } ` )
280+ : fileIconAssetPath ( "compact/unknown-light" ) ;
281+ const dark = large
282+ ? fileIconAssetPath ( "large/shell-dark" )
283+ : resolved . compact
284+ ? fileIconAssetPath ( `compact/dark/${ resolved . compact } ` )
285+ : fileIconAssetPath ( "compact/unknown-dark" ) ;
280286 return html `< span
281287 class ="chat-attachment-file-icon ${ options . unavailable
282288 ? "chat-attachment-file-icon--unavailable"
@@ -285,16 +291,14 @@ export function renderAttachmentFileIcon(options: {
285291 data-mode =${ options . mode }
286292 aria-hidden="true"
287293 style=${ styleMap ( {
288- "--chat-file-icon-shell-light" : `url("${ fileIconAssetPath ( "large/shell-light" ) } ")` ,
289- "--chat-file-icon-shell-dark" : `url("${ fileIconAssetPath ( "large/shell-dark" ) } ")` ,
294+ width : size ,
295+ height : size ,
296+ "--chat-file-icon-light" : `url("${ light } ")` ,
297+ "--chat-file-icon-dark" : `url("${ dark } ")` ,
290298 "--chat-file-icon-overlay" : `url("${ fileIconAssetPath ( `overlays/${ resolved . family } ` ) } ")` ,
291299 "--chat-file-icon-accent" : resolved . accent ,
292- "--chat-file-icon-compact-light" : `url("${ compactLight } ")` ,
293- "--chat-file-icon-compact-dark" : `url("${ compactDark } ")` ,
294300 } ) }
295301 >
296- ${ options . mode === "large-placeholder"
297- ? html `< span class ="chat-attachment-file-icon__overlay "> </ span > `
298- : null }
302+ ${ large ? html `< span class ="chat-attachment-file-icon__overlay "> </ span > ` : null }
299303 </ span > ` ;
300304}
0 commit comments