/** * 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, taken_at, filename, city, state, country, type, source } = properties const takenDate = taken_at ? new Date(taken_at).toLocaleString() : 'Unknown' const location = [city, state, country].filter(Boolean).join(', ') || 'Unknown location' const mediaType = type === 'VIDEO' ? '🎥 Video' : '📷 Photo' return `
${filename}
${filename}
Taken: ${takenDate}
Location: ${location}
Source: ${source}
${mediaType}
` } }