show magnet/torrent links

This commit is contained in:
Kieran 2023-03-24 22:28:50 +00:00
parent c7bc3c50f7
commit 78997071a1
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 26 additions and 7 deletions

View File

@ -242,9 +242,24 @@ export function FilePreview() {
{info.uploader ? <InlineProfile profile={info.uploader}/> : null}
</div>
<div>
{canAccessFile() ?
<a className="btn" href={link}
download={info.metadata?.name ?? info.id}>Download</a> : null}
{canAccessFile() &&
<>
<a className="btn" href={info?.metadata?.magnetLink}>
<FeatherIcon icon="link" size="14px" className="mr10"/>
Magnet
</a>
<a className="btn" href={`${link}.torrent`}
download={info.metadata?.name ?? info.id}>
<FeatherIcon icon="file" size="14px" className="mr10"/>
Torrent
</a>
<a className="btn" href={link}
download={info.metadata?.name ?? info.id}>
<FeatherIcon icon="download" size="14px" className="mr10"/>
Direct Download
</a>
</>}
</div>
</div>
{renderPayment()}

View File

@ -98,3 +98,7 @@ pre.copy {
border: 1px solid;
padding: 5px;
}
.mr10 {
margin-right: 10px;
}