- { props.sharingTokens.length > 0
- ? props.sharingTokens
- .sort((a, b) => (new Date(a.expiresAt).getTime() - new Date(b.expiresAt).getTime()))
- .map(token => {
- const url = props.sharingURLsPrefix.includes('*')
- ? `${props.sharingURLsPrefix.replace('*', props.collectionUuid)}/t=${token.apiToken}/_/`
- : `${props.sharingURLsPrefix}/c=${props.collectionUuid}/t=${token.apiToken}/_/`;
- const expDate = new Date(token.expiresAt);
- const urlLabel = !!token.expiresAt
- ? `Token ${token.apiToken.slice(0, 8)}... expiring at: ${expDate.toLocaleString()} (${moment(expDate).fromNow()})`
- : `Token ${token.apiToken.slice(0, 8)}... with no expiration date`;
+ {props.sharingTokens.length > 0
+ ? props.sharingTokens
+ .sort((a, b) => (new Date(a.expiresAt).getTime() - new Date(b.expiresAt).getTime()))
+ .map(token => {
+ const url = props.sharingURLsPrefix.includes('*')
+ ? `${props.sharingURLsPrefix.replace('*', props.collectionUuid)}/t=${token.apiToken}/_/`
+ : `${props.sharingURLsPrefix}/c=${props.collectionUuid}/t=${token.apiToken}/_/`;
+ const expDate = new Date(token.expiresAt);
+ const urlLabel = !!token.expiresAt
+ ? `Token ${token.apiToken.slice(0, 8)}... expiring at: ${expDate.toLocaleString()} (${moment(expDate).fromNow()})`
+ : `Token ${token.apiToken.slice(0, 8)}... with no expiration date`;