/** * Factory for creating photo popups */ export class PhotoPopupFactory { /** * Create popup for a photo * @param {Object} properties - Photo properties * @returns {string} HTML for popup */ static createPhotoPopup(properties) { const { id, thumbnail_url, url, taken_at, camera, location_name } = properties const takenDate = taken_at ? new Date(taken_at * 1000).toLocaleString() : null return `
Photo
${location_name ? `
${location_name}
` : ''} ${takenDate ? `
${takenDate}
` : ''} ${camera ? `
${camera}
` : ''}
View Full Size →
` } }