tweak: add hr between attachments

This commit is contained in:
alvaromartmart 2024-06-24 23:42:36 +02:00
parent e4f773e3ea
commit e27aa15e12
2 changed files with 14 additions and 7 deletions

View file

@ -53,3 +53,7 @@
border-radius: 2px; border-radius: 2px;
padding: 0.5rem; padding: 0.5rem;
} }
.attachment-item hr {
border: 0.2px solid var(--vscode-panel-border);
}

View file

@ -106,13 +106,16 @@ export const AttachmentsTab: React.FunctionComponent<{
})} })}
{attachments.size ? <div className='attachments-section'>Attachments</div> : undefined} {attachments.size ? <div className='attachments-section'>Attachments</div> : undefined}
{[...attachments.values()].map((a, i) => { {[...attachments.values()].map((a, i) => {
return <div className='attachment-item' key={`attachment-${i}`}> return <>
<a href={attachmentURL(a) + '&download'}>{a.name}</a> { i > 0 && <hr /> }
{ isTextualMimeType(a.contentType) ? <div className='attachment-item' key={`attachment-${i}`}>
<TextAttachment attachment={a} /> : <a href={attachmentURL(a) + '&download'}>{a.name}</a>
<div><i>no preview available</i></div> { isTextualMimeType(a.contentType) ?
} <TextAttachment attachment={a} /> :
</div>; <div><i>no preview available</i></div>
}
</div>
</>;
})} })}
</div>; </div>;
}; };