import { Controller } from '@hotwired/stimulus'; export default class extends Controller { static targets = ["checkbox", "modal", "modalContent"] toggleAllCheckboxes(event) { this.checkboxTargets.forEach(checkbox => { checkbox.checked = event.target.checked; }); } updateMangaInfo(event) { const select = event.target; const selectedOption = select.options[select.selectedIndex]; const mangaInfo = JSON.parse(selectedOption.dataset.mangaInfo); } showDetails(event) { const fileId = event.currentTarget.dataset.fileId; const select = document.querySelector(`select[name="manga_slug[${fileId}]"]`); const mangaInfo = JSON.parse(select.options[select.selectedIndex].dataset.mangaInfo); this.modalContentTarget.innerHTML = `
Author: ${mangaInfo.author || 'N/A'}
Publication Year: ${mangaInfo.publicationYear || 'N/A'}
Genres: ${mangaInfo.genres ? mangaInfo.genres.join(', ') : 'N/A'}
Description: ${this.truncate(mangaInfo.description || 'N/A', 200)}