handleCardClick(tag)}
+ >
+ {/* Thumbnail — representative photo or placeholder */}
+
+ {tag.representative_photo_id ? (
+

+ ) : (
+
+
+
+ )}
+
+ {/* Photo count badge */}
+
+ {tag.photo_count}
+
+
+ {/* Edit button — visible on hover */}
+
+
+
+ {/* Name — inline editable */}
+
+ {editingId === tag.id ? (
+
e.stopPropagation()}>
+ setEditName(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') submitRename()
+ if (e.key === 'Escape') setEditingId(null)
+ }}
+ className="min-w-0 flex-1 rounded border border-border bg-bg px-1.5 py-0.5 text-xs text-text focus:border-primary focus:outline-none"
+ />
+
+
+
+ ) : (
+
{tag.name}
+ )}
+
+