/** * @copyright 2026 NHCarrigan * @license Naomi's Public License * @author Naomi Carrigan */ import { Component, OnInit, inject, signal, computed } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { MangaService } from '../../services/manga.service'; import { AuthService } from '../../services/auth.service'; import { CommentsService } from '../../services/comments.service'; import { SanitizeService } from '../../services/sanitize.service'; import { SuggestionService } from '../../services/suggestion.service'; import { PaginationComponent } from '../shared/pagination.component'; import { Manga, MangaStatus, CreateMangaDto, UpdateMangaDto, Comment, SuggestionEntity, Link } from '@library/shared-types'; @Component({ selector: 'app-manga-list', standalone: true, imports: [CommonModule, FormsModule, PaginationComponent], template: `

My Manga Collection

@if (authService.isAdmin()) { } @else if (authService.isAuthenticated() && !authService.user()?.isBanned) { }
@if (showAddForm() && authService.isAdmin()) {

Add New Manga

@if (newMangaImagePreview()) {
Cover preview
} @if (imageError()) { {{ imageError() }} }
@for (tag of newManga.tags; track tag; let i = $index) { {{ tag }} }
} @if (editingManga() && authService.isAdmin()) {

Edit Manga

@if (editMangaImagePreview()) {
Cover preview
} @if (imageError()) { {{ imageError() }} }
@for (tag of editManga.tags; track tag; let i = $index) { {{ tag }} }
} @if (showSuggestForm() && !authService.isAdmin() && authService.isAuthenticated()) {

Suggest a Manga

Your suggestion will be reviewed by Naomi. If accepted, it will be added to the reading list!

@if (suggestMangaImagePreview()) {
Cover preview
} @if (imageError()) { {{ imageError() }} }
}
@if (searchQuery() || selectedTags().length > 0) { }
@if (showFilters()) {

Filter by Tags

@for (tag of allTags(); track tag) { } @empty {

No tags available

}
}
@if (loading()) {
Loading manga...
} @else if (filteredManga().length === 0) {

No manga found in this category.

} @else {
@for (manga of paginatedManga(); track manga.id) {
@if (manga.coverImage) { }

{{ manga.title }}

by {{ manga.author }}

{{ getStatusLabel(manga.status) }} @if (manga.rating) {
@for (star of [1,2,3,4,5,6,7,8,9,10]; track star) { }
} @if (manga.notes) {

{{ manga.notes }}

} @if (manga.tags && manga.tags.length > 0) {
@for (tag of manga.tags; track tag) { {{ tag }} }
} @if (manga.links && manga.links.length > 0) { } @if (authService.isAdmin()) {
}
@if (expandedComments()[manga.id]) {
@if (authService.isAuthenticated()) { @if (authService.user()?.isBanned) {
You have been banned from commenting.
} @else {
} } @if (commentsLoading()[manga.id]) {
Loading comments...
} @else { @for (comment of comments()[manga.id] || []; track comment.id) {
@if (comment.user.avatar) { } {{ comment.user.username }} @if (comment.user.inDiscord) { Discord } @if (comment.user.isVip) { VIP } @if (comment.user.isMod) { Mod } @if (comment.user.isStaff) { Staff } {{ formatDate(comment.createdAt) }} @if (canEditComment(comment)) { } @if (canDeleteComment(comment)) { }
@if (editingCommentId() === comment.id) {
} @else {
}
} @empty {
No comments yet. Be the first to comment!
} }
}
}
}
`, styles: [` .container { max-width: 1200px; margin: 0 auto; padding: 2rem; } .header-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; } h2 { margin: 0; } .add-form { background: #f8f9fa; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; } .suggest-form { border: 2px solid #00b894; background: #f5fffc; } .suggest-note { color: #666; font-size: 0.9rem; margin-bottom: 1rem; font-style: italic; } .form-group { margin-bottom: 1rem; } .form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; } .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; } .form-actions { display: flex; gap: 1rem; margin-top: 1rem; } .search-section { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; } .search-input { flex: 1; min-width: 250px; padding: 0.5rem 1rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; } .search-input:focus { outline: none; border-color: #00b894; } .advanced-filters { background: #f8f9fa; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; } .filter-group h4 { margin: 0 0 0.75rem 0; color: #374151; font-size: 0.95rem; font-weight: 600; } .tags-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; } .tag-checkbox { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.25rem 0.75rem; border: 1px solid #e5e7eb; border-radius: 20px; background: white; transition: all 0.2s; } .tag-checkbox:hover { border-color: #00b894; background: #f5fffc; } .tag-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; } .tag-checkbox span { font-size: 0.875rem; color: #374151; } .no-tags { color: #6b7280; font-style: italic; font-size: 0.875rem; } .filters { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; } .filter-btn { padding: 0.5rem 1rem; background: #e5e7eb; border: none; border-radius: 4px; cursor: pointer; transition: all 0.3s; } .filter-btn:hover { background: #d1d5db; } .filter-btn.active { background: #00b894; color: white; } .loading { text-align: center; padding: 2rem; color: #666; } .empty-state { text-align: center; padding: 3rem; color: #666; } .manga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; } .manga-card { background: white; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; } .manga-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); } .manga-card.completed { opacity: 0.8; } .manga-cover { width: 100%; height: 200px; object-fit: cover; } .manga-info { padding: 1rem; } .manga-info h3 { margin: 0 0 0.5rem 0; font-size: 1.1rem; } .author { color: #666; font-size: 0.9rem; margin: 0.5rem 0; font-style: italic; } .status { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; } .status-READING { background: #fef3c7; color: #92400e; } .status-COMPLETED { background: #d1fae5; color: #065f46; } .status-WANT_TO_READ { background: #fce7f3; color: #9d174d; } .rating { margin: 0.5rem 0; } .rating span { color: #e5e7eb; font-size: 1rem; } .rating span.filled { color: #ec4899; } .notes { font-size: 0.9rem; color: #4b5563; margin: 0.5rem 0; } .actions { margin-top: 1rem; } .btn { padding: 0.5rem 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; transition: opacity 0.3s; } .btn:hover { opacity: 0.8; } .btn-primary { background: #00b894; color: white; } .btn-secondary { background: #6b7280; color: white; } .btn-danger { background: #ef4444; color: white; } .btn-sm { padding: 0.25rem 0.75rem; font-size: 0.85rem; } .btn-xs { padding: 0.15rem 0.5rem; font-size: 0.75rem; } .comments-section { margin-top: 1rem; border-top: 1px solid #e5e7eb; padding-top: 1rem; } .comments-toggle { width: 100%; } .comments-container { margin-top: 1rem; } .comment-form { margin-bottom: 1rem; } .comment-form textarea { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; resize: vertical; margin-bottom: 0.5rem; } .comment { background: #f8f9fa; border: 1px solid #e5e7eb; border-radius: 4px; padding: 0.75rem; margin-bottom: 0.5rem; } .comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; } .comment-avatar { width: 24px; height: 24px; border-radius: 50%; } .comment-author { font-weight: 500; color: #374151; } .discord-badge { background: #5865f2; color: white; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 500; } .vip-badge { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a1a; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 600; } .mod-badge { background: linear-gradient(135deg, #00b894, #00cec9); color: white; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 600; } .staff-badge { background: linear-gradient(135deg, #e84393, #fd79a8); color: white; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 600; } .comment-date { font-size: 0.75rem; color: #6b7280; } .comment-content { font-size: 0.9rem; color: #4b5563; } .comments-loading, .no-comments { text-align: center; padding: 1rem; color: #6b7280; font-size: 0.9rem; } .banned-notice { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 0.75rem 1rem; border-radius: 4px; text-align: center; margin-bottom: 1rem; font-size: 0.9rem; } .comment-edit-form { margin-top: 0.5rem; } .comment-edit-form textarea { width: 100%; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; resize: vertical; } .comment-edit-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; } .image-preview { margin-top: 0.5rem; display: flex; align-items: center; gap: 1rem; } .image-preview img { max-width: 100px; max-height: 150px; border-radius: 4px; border: 2px solid #e5e7eb; } .error-text { color: #ef4444; font-size: 0.875rem; display: block; margin-top: 0.25rem; } input[type="file"] { padding: 0.5rem; border: 2px dashed #e5e7eb; border-radius: 4px; background: #f9fafb; cursor: pointer; } input[type="file"]:hover { border-color: #ec4899; } .tags-input-container { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; background: #f9fafb; } .tags-input-container input { flex: 1; min-width: 150px; border: none; padding: 0.25rem; font-size: 0.9rem; background: transparent; } .tags-input-container input:focus { outline: none; } .tag { display: inline-flex; align-items: center; gap: 0.25rem; background: #00b894; color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem; } .tag-remove { background: none; border: none; color: white; cursor: pointer; padding: 0; font-size: 1rem; line-height: 1; } .tag-remove:hover { opacity: 0.8; } .tags-display { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; } .tag-chip { background: rgba(0, 184, 148, 0.2); color: #00b894; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; } .links-list { margin-bottom: 0.5rem; } .link-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; background: #f9fafb; border-radius: 4px; margin-bottom: 0.25rem; } .link-add-form { display: flex; gap: 0.5rem; flex-wrap: wrap; } .link-add-form input { flex: 1; min-width: 120px; } .links-display { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; } .external-link { color: #00b894; text-decoration: none; font-size: 0.85rem; padding: 0.2rem 0.5rem; background: rgba(0, 184, 148, 0.1); border-radius: 4px; transition: background 0.2s; } .external-link:hover { background: rgba(0, 184, 148, 0.2); text-decoration: underline; } `] }) export class MangaListComponent implements OnInit { mangaService = inject(MangaService); authService = inject(AuthService); commentsService = inject(CommentsService); sanitizeService = inject(SanitizeService); suggestionService = inject(SuggestionService); mangaList = signal([]); loading = signal(true); showAddForm = signal(false); editingManga = signal(null); statusFilter = signal<'all' | MangaStatus>('all'); // Pagination state currentPage = signal(1); pageSize = signal(25); // Search and filter state searchQuery = signal(''); selectedTags = signal([]); showFilters = signal(false); comments = signal>({}); commentsLoading = signal>({}); expandedComments = signal>({}); newCommentContent: Record = {}; editingCommentId = signal(null); editCommentContent = ''; newMangaImagePreview = signal(null); editMangaImagePreview = signal(null); suggestMangaImagePreview = signal(null); imageError = signal(null); private readonly MAX_IMAGE_SIZE = 500 * 1024; // Suggestion state showSuggestForm = signal(false); suggestedManga: { title: string; author: string; notes?: string; coverImage?: string } = { title: '', author: '', notes: '', coverImage: undefined }; MangaStatus = MangaStatus; readingCount = computed(() => this.mangaList().filter(m => m.status === MangaStatus.reading).length); completedCount = computed(() => this.mangaList().filter(m => m.status === MangaStatus.completed).length); wantToReadCount = computed(() => this.mangaList().filter(m => m.status === MangaStatus.wantToRead).length); allTags = computed(() => { const tagsSet = new Set(); this.mangaList().forEach(manga => { manga.tags?.forEach(tag => tagsSet.add(tag)); }); return Array.from(tagsSet).sort(); }); filteredManga = computed(() => { let manga = this.mangaList(); // Apply status filter const statusFilter = this.statusFilter(); if (statusFilter !== 'all') { manga = manga.filter(m => m.status === statusFilter); } // Apply search filter const searchQuery = this.searchQuery().toLowerCase().trim(); if (searchQuery) { manga = manga.filter(m => m.title.toLowerCase().includes(searchQuery) || m.author.toLowerCase().includes(searchQuery) || m.notes?.toLowerCase().includes(searchQuery) ); } // Apply tag filter const selectedTags = this.selectedTags(); if (selectedTags.length > 0) { manga = manga.filter(m => selectedTags.every(tag => m.tags?.includes(tag)) ); } return manga; }); paginatedManga = computed(() => { const manga = this.filteredManga(); const start = (this.currentPage() - 1) * this.pageSize(); const end = start + this.pageSize(); return manga.slice(start, end); }); totalFilteredManga = computed(() => this.filteredManga().length); newManga: Partial = { title: '', author: '', status: MangaStatus.wantToRead, rating: undefined, notes: '', tags: [], links: [] }; editManga: Partial = {}; // Tags and links input state newTagInput = ''; editTagInput = ''; newLinkTitle = ''; newLinkUrl = ''; editLinkTitle = ''; editLinkUrl = ''; ngOnInit() { this.loadManga(); } loadManga() { this.loading.set(true); this.mangaService.getAllManga().subscribe({ next: (manga) => { this.mangaList.set(manga); this.loading.set(false); }, error: () => { this.loading.set(false); } }); } setFilter(filter: 'all' | MangaStatus) { this.statusFilter.set(filter); this.currentPage.set(1); // Reset to first page when filter changes } toggleTag(tag: string) { const current = this.selectedTags(); if (current.includes(tag)) { this.selectedTags.set(current.filter(t => t !== tag)); } else { this.selectedTags.set([...current, tag]); } this.currentPage.set(1); // Reset to first page when tags change } clearFilters() { this.searchQuery.set(''); this.selectedTags.set([]); this.statusFilter.set('all'); this.currentPage.set(1); } toggleFilters() { this.showFilters.update(v => !v); } onPageChange(page: number) { this.currentPage.set(page); } onPageSizeChange(pageSize: number) { this.pageSize.set(pageSize); // Calculate new current page to stay on approximately the same content const firstItemIndex = (this.currentPage() - 1) * this.pageSize(); const newPage = Math.floor(firstItemIndex / pageSize) + 1; this.currentPage.set(newPage); } getStatusLabel(status: MangaStatus): string { switch (status) { case MangaStatus.reading: return 'Currently Reading'; case MangaStatus.completed: return 'Completed'; case MangaStatus.wantToRead: return 'Want to Read'; } } toggleAddForm() { this.showAddForm.update(v => !v); if (!this.showAddForm()) { this.resetForm(); } } resetForm() { this.newManga = { title: '', author: '', status: MangaStatus.wantToRead, rating: undefined, notes: '', coverImage: undefined, tags: [], links: [] }; this.newMangaImagePreview.set(null); this.imageError.set(null); this.newTagInput = ''; this.newLinkTitle = ''; this.newLinkUrl = ''; } addTag(target: 'new' | 'edit') { const input = target === 'new' ? this.newTagInput.trim() : this.editTagInput.trim(); if (!input) return; if (target === 'new') { this.newManga.tags = [...(this.newManga.tags || []), input]; this.newTagInput = ''; } else { this.editManga.tags = [...(this.editManga.tags || []), input]; this.editTagInput = ''; } } removeTag(index: number, target: 'new' | 'edit') { if (target === 'new') { this.newManga.tags = (this.newManga.tags || []).filter((_, i) => i !== index); } else { this.editManga.tags = (this.editManga.tags || []).filter((_, i) => i !== index); } } addLink(target: 'new' | 'edit') { const title = target === 'new' ? this.newLinkTitle.trim() : this.editLinkTitle.trim(); const url = target === 'new' ? this.newLinkUrl.trim() : this.editLinkUrl.trim(); if (!title || !url) return; if (target === 'new') { this.newManga.links = [...(this.newManga.links || []), { title, url }]; this.newLinkTitle = ''; this.newLinkUrl = ''; } else { this.editManga.links = [...(this.editManga.links || []), { title, url }]; this.editLinkTitle = ''; this.editLinkUrl = ''; } } removeLink(index: number, target: 'new' | 'edit') { if (target === 'new') { this.newManga.links = (this.newManga.links || []).filter((_, i) => i !== index); } else { this.editManga.links = (this.editManga.links || []).filter((_, i) => i !== index); } } addManga() { if (!this.newManga.title || !this.newManga.author || !this.newManga.status) return; const mangaToAdd: CreateMangaDto = { title: this.newManga.title, author: this.newManga.author, status: this.newManga.status, rating: this.newManga.rating, notes: this.newManga.notes, coverImage: this.newManga.coverImage, tags: this.newManga.tags || [], links: this.newManga.links || [] }; this.mangaService.createManga(mangaToAdd).subscribe(() => { this.loadManga(); this.toggleAddForm(); }); } deleteManga(manga: Manga) { if (confirm(`Are you sure you want to delete "${manga.title}"?`)) { this.mangaService.deleteManga(manga.id).subscribe(() => { this.loadManga(); }); } } startEdit(manga: Manga) { this.editingManga.set(manga); this.editManga = { title: manga.title, author: manga.author, status: manga.status, rating: manga.rating, notes: manga.notes, coverImage: manga.coverImage, tags: [...(manga.tags || [])], links: [...(manga.links || [])] }; this.editMangaImagePreview.set(manga.coverImage || null); this.showAddForm.set(false); this.imageError.set(null); this.editTagInput = ''; this.editLinkTitle = ''; this.editLinkUrl = ''; } cancelEdit() { this.editingManga.set(null); this.editManga = {}; this.editMangaImagePreview.set(null); this.imageError.set(null); this.editTagInput = ''; this.editLinkTitle = ''; this.editLinkUrl = ''; } saveEdit() { const manga = this.editingManga(); if (!manga || !this.editManga.title || !this.editManga.author || !this.editManga.status) return; this.mangaService.updateManga(manga.id, this.editManga).subscribe(() => { this.loadManga(); this.cancelEdit(); }); } onImageSelected(event: Event, target: 'new' | 'edit' | 'suggest') { const input = event.target as HTMLInputElement; const file = input.files?.[0]; if (!file) return; this.imageError.set(null); if (file.size > this.MAX_IMAGE_SIZE) { this.imageError.set(`Image too large. Maximum size is ${this.MAX_IMAGE_SIZE / 1024}KB.`); input.value = ''; return; } if (!file.type.startsWith('image/')) { this.imageError.set('Please select an image file.'); input.value = ''; return; } const reader = new FileReader(); reader.onload = () => { const base64 = reader.result as string; if (target === 'new') { this.newMangaImagePreview.set(base64); this.newManga.coverImage = base64; } else if (target === 'edit') { this.editMangaImagePreview.set(base64); this.editManga.coverImage = base64; } else { this.suggestMangaImagePreview.set(base64); this.suggestedManga.coverImage = base64; } }; reader.readAsDataURL(file); } clearImage(target: 'new' | 'edit' | 'suggest') { if (target === 'new') { this.newMangaImagePreview.set(null); this.newManga.coverImage = undefined; } else if (target === 'edit') { this.editMangaImagePreview.set(null); this.editManga.coverImage = undefined; } else { this.suggestMangaImagePreview.set(null); this.suggestedManga.coverImage = undefined; } this.imageError.set(null); } formatDate(date: Date | string): string { return new Date(date).toLocaleDateString(); } toggleComments(mangaId: string) { const expanded = this.expandedComments(); const isCurrentlyExpanded = expanded[mangaId]; this.expandedComments.set({ ...expanded, [mangaId]: !isCurrentlyExpanded }); if (!isCurrentlyExpanded && !this.comments()[mangaId]) { this.loadComments(mangaId); } } loadComments(mangaId: string) { this.commentsLoading.set({ ...this.commentsLoading(), [mangaId]: true }); this.commentsService.getCommentsForManga(mangaId).subscribe({ next: (comments) => { this.comments.set({ ...this.comments(), [mangaId]: comments }); this.commentsLoading.set({ ...this.commentsLoading(), [mangaId]: false }); }, error: () => { this.commentsLoading.set({ ...this.commentsLoading(), [mangaId]: false }); } }); } getCommentCount(mangaId: string): number { return this.comments()[mangaId]?.length || 0; } addComment(mangaId: string) { const content = this.newCommentContent[mangaId]; if (!content?.trim()) return; this.commentsService.addCommentToManga(mangaId, { content }).subscribe({ next: (comment) => { this.comments.set({ ...this.comments(), [mangaId]: [comment, ...(this.comments()[mangaId] || [])] }); this.newCommentContent[mangaId] = ''; } }); } deleteComment(mangaId: string, commentId: string) { if (!confirm('Are you sure you want to delete this comment?')) return; this.commentsService.deleteCommentFromManga(mangaId, commentId).subscribe({ next: () => { this.comments.set({ ...this.comments(), [mangaId]: (this.comments()[mangaId] || []).filter(c => c.id !== commentId) }); } }); } canEditComment(comment: Comment): boolean { const user = this.authService.user(); if (!user) return false; return comment.userId === user.id || this.authService.isAdmin(); } canDeleteComment(comment: Comment): boolean { const user = this.authService.user(); if (!user) return false; return comment.userId === user.id || this.authService.isAdmin(); } startEditComment(mangaId: string, comment: Comment) { this.editingCommentId.set(comment.id); this.editCommentContent = comment.rawContent ?? comment.content; } cancelCommentEdit() { this.editingCommentId.set(null); this.editCommentContent = ''; } saveCommentEdit(mangaId: string, commentId: string) { if (!this.editCommentContent.trim()) return; this.commentsService.updateCommentOnManga(mangaId, commentId, this.editCommentContent).subscribe({ next: (updatedComment) => { this.comments.set({ ...this.comments(), [mangaId]: (this.comments()[mangaId] || []).map(c => c.id === commentId ? updatedComment : c ) }); this.cancelCommentEdit(); } }); } // Suggestion methods toggleSuggestForm() { this.showSuggestForm.update(v => !v); if (!this.showSuggestForm()) { this.resetSuggestForm(); } } resetSuggestForm() { this.suggestedManga = { title: '', author: '', notes: '', coverImage: undefined }; this.suggestMangaImagePreview.set(null); this.imageError.set(null); } async submitSuggestion() { if (!this.suggestedManga.title || !this.suggestedManga.author) return; try { await this.suggestionService.createSuggestion({ entityType: SuggestionEntity.MANGA, title: this.suggestedManga.title, author: this.suggestedManga.author, notes: this.suggestedManga.notes, coverImage: this.suggestedManga.coverImage }); alert('Thank you for your suggestion! It will be reviewed soon.'); this.toggleSuggestForm(); } catch { alert('Failed to submit suggestion. Please try again.'); } } }