codebybrody commited on
Commit
ed5f376
·
verified ·
1 Parent(s): 29ecde8

Upload 105 files

Browse files
src/components/CreateFolderModal.tsx CHANGED
@@ -1,88 +1,88 @@
1
- import { useState } from 'react';
2
- import { X, FolderPlus } from 'lucide-react';
3
- import { toast } from 'sonner';
4
- import { createFolderAndMove } from '../services/manga';
5
-
6
- interface CreateFolderModalProps {
7
- isOpen: boolean;
8
- onClose: () => void;
9
- selectedMangaIds: string[];
10
- onSaveComplete: () => void;
11
- }
12
-
13
- export function CreateFolderModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: CreateFolderModalProps) {
14
- const [folderName, setFolderName] = useState('');
15
- const [isSaving, setIsSaving] = useState(false);
16
-
17
- const handleSave = async () => {
18
- if (!folderName.trim()) {
19
- toast.error('Gamba: Escribe un nombre para la carpeta');
20
- return;
21
- }
22
-
23
- try {
24
- setIsSaving(true);
25
- await createFolderAndMove(folderName.trim(), selectedMangaIds);
26
- toast.success(`Carpeta "${folderName}" creada exitosamente.`);
27
- onSaveComplete();
28
- onClose();
29
- setFolderName('');
30
- } catch (error) {
31
- console.error('Error creating folder:', error);
32
- toast.error('Error al crear la carpeta');
33
- } finally {
34
- setIsSaving(false);
35
- }
36
- };
37
-
38
- if (!isOpen) return null;
39
-
40
- return (
41
- <div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-4 animate-in fade-in duration-200">
42
- <div className="bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-sm shadow-2xl overflow-hidden flex flex-col">
43
- <div className="bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between">
44
- <div className="flex items-center gap-3">
45
- <div className="p-2 bg-purple-500/10 rounded-lg text-purple-400">
46
- <FolderPlus className="w-5 h-5" />
47
- </div>
48
- <div>
49
- <h2 className="text-xl font-bold text-white">Crear Carpeta</h2>
50
- <p className="text-xs text-gray-400">{selectedMangaIds.length} elementos seleccionados</p>
51
- </div>
52
- </div>
53
- <button onClick={onClose} className="text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg">
54
- <X className="w-5 h-5" />
55
- </button>
56
- </div>
57
-
58
- <div className="p-6">
59
- <input
60
- type="text"
61
- value={folderName}
62
- onChange={(e) => setFolderName(e.target.value)}
63
- placeholder="Nombre de la nueva carpeta"
64
- className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-purple-500 transition-colors"
65
- autoFocus
66
- />
67
- </div>
68
-
69
- <div className="bg-[#1a1a1a] border-t border-gray-800 px-6 py-4 flex justify-end gap-3">
70
- <button
71
- onClick={onClose}
72
- className="px-4 py-2 text-sm font-semibold text-gray-300 hover:text-white transition-colors"
73
- disabled={isSaving}
74
- >
75
- Cancelar
76
- </button>
77
- <button
78
- onClick={handleSave}
79
- disabled={isSaving || !folderName.trim()}
80
- className="bg-purple-600 hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed text-white px-6 py-2 rounded-lg text-sm font-bold shadow-lg shadow-purple-500/20 transition-all flex items-center gap-2"
81
- >
82
- {isSaving ? 'Creando...' : 'Crear'}
83
- </button>
84
- </div>
85
- </div>
86
- </div>
87
- );
88
- }
 
1
+ import { useState } from 'react';
2
+ import { X, FolderPlus } from 'lucide-react';
3
+ import { toast } from 'sonner';
4
+ import { createFolderAndMove } from '../services/manga';
5
+
6
+ interface CreateFolderModalProps {
7
+ isOpen: boolean;
8
+ onClose: () => void;
9
+ selectedMangaIds: string[];
10
+ onSaveComplete: () => void;
11
+ }
12
+
13
+ export function CreateFolderModal({ isOpen, onClose, selectedMangaIds, onSaveComplete }: CreateFolderModalProps) {
14
+ const [folderName, setFolderName] = useState('');
15
+ const [isSaving, setIsSaving] = useState(false);
16
+
17
+ const handleSave = async () => {
18
+ if (!folderName.trim()) {
19
+ toast.error('Gamba: Escribe un nombre para la carpeta');
20
+ return;
21
+ }
22
+
23
+ try {
24
+ setIsSaving(true);
25
+ await createFolderAndMove(folderName.trim(), selectedMangaIds);
26
+ toast.success(`Carpeta "${folderName}" creada exitosamente.`);
27
+ onSaveComplete();
28
+ onClose();
29
+ setFolderName('');
30
+ } catch (error) {
31
+ console.error('Error creating folder:', error);
32
+ toast.error('Error al crear la carpeta');
33
+ } finally {
34
+ setIsSaving(false);
35
+ }
36
+ };
37
+
38
+ if (!isOpen) return null;
39
+
40
+ return (
41
+ <div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-4 animate-in fade-in duration-200">
42
+ <div className="bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-sm shadow-2xl overflow-hidden flex flex-col">
43
+ <div className="bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between">
44
+ <div className="flex items-center gap-3">
45
+ <div className="p-2 bg-purple-500/10 rounded-lg text-purple-400">
46
+ <FolderPlus className="w-5 h-5" />
47
+ </div>
48
+ <div>
49
+ <h2 className="text-xl font-bold text-white">Crear Carpeta</h2>
50
+ <p className="text-xs text-gray-400">{selectedMangaIds.length} elementos seleccionados</p>
51
+ </div>
52
+ </div>
53
+ <button onClick={onClose} className="text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg">
54
+ <X className="w-5 h-5" />
55
+ </button>
56
+ </div>
57
+
58
+ <div className="p-6">
59
+ <input
60
+ type="text"
61
+ value={folderName}
62
+ onChange={(e) => setFolderName(e.target.value)}
63
+ placeholder="Nombre de la nueva carpeta"
64
+ className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl px-4 py-3 text-sm text-white focus:outline-none focus:border-purple-500 transition-colors"
65
+ autoFocus
66
+ />
67
+ </div>
68
+
69
+ <div className="bg-[#1a1a1a] border-t border-gray-800 px-6 py-4 flex justify-end gap-3">
70
+ <button
71
+ onClick={onClose}
72
+ className="px-4 py-2 text-sm font-semibold text-gray-300 hover:text-white transition-colors"
73
+ disabled={isSaving}
74
+ >
75
+ Cancelar
76
+ </button>
77
+ <button
78
+ onClick={handleSave}
79
+ disabled={isSaving || !folderName.trim()}
80
+ className="bg-purple-600 hover:bg-purple-700 disabled:opacity-50 disabled:cursor-not-allowed text-white px-6 py-2 rounded-lg text-sm font-bold shadow-lg shadow-purple-500/20 transition-all flex items-center gap-2"
81
+ >
82
+ {isSaving ? 'Creando...' : 'Crear'}
83
+ </button>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ );
88
+ }
src/components/MangaCard.tsx CHANGED
@@ -175,7 +175,7 @@ export function MangaCard({ id, title, author, pageCount, thumbnail, manga, onSe
175
  />
176
  )}
177
  </div>
178
- <div className="absolute inset-x-0 bottom-0 h-1/2 bg-gradient-to-t from-black/90 to-transparent pointer-events-none z-10"></div>
179
 
180
  {/* Iconito Glassmorphism en la esquina inferior derecha */}
181
  <div className="absolute bottom-2 right-2 z-20 flex items-center justify-center bg-white/10 backdrop-blur-md rounded-lg p-1.5 border border-white/20 shadow-xl transition-all duration-300 group-hover:bg-white/20 group-hover:scale-110">
 
175
  />
176
  )}
177
  </div>
178
+ <div className="absolute inset-x-0 bottom-0 h-1/3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none z-10"></div>
179
 
180
  {/* Iconito Glassmorphism en la esquina inferior derecha */}
181
  <div className="absolute bottom-2 right-2 z-20 flex items-center justify-center bg-white/10 backdrop-blur-md rounded-lg p-1.5 border border-white/20 shadow-xl transition-all duration-300 group-hover:bg-white/20 group-hover:scale-110">
src/components/MoveToFolderModal.tsx CHANGED
@@ -1,125 +1,125 @@
1
- import { useState, useMemo } from 'react';
2
- import { X, FolderInput, Search } from 'lucide-react';
3
- import { toast } from 'sonner';
4
- import { moveToFolder } from '../services/manga';
5
- import { Manga } from '../types/manga';
6
-
7
- interface MoveToFolderModalProps {
8
- isOpen: boolean;
9
- onClose: () => void;
10
- selectedMangaIds: string[];
11
- mangas: Manga[];
12
- onSaveComplete: () => void;
13
- }
14
-
15
- export function MoveToFolderModal({ isOpen, onClose, selectedMangaIds, mangas, onSaveComplete }: MoveToFolderModalProps) {
16
- const [searchTerm, setSearchTerm] = useState('');
17
- const [isSaving, setIsSaving] = useState(false);
18
-
19
- const folders = useMemo(() => {
20
- return mangas
21
- .filter(m => m.is_folder && !selectedMangaIds.includes(m.id))
22
- .sort((a, b) => a.title.localeCompare(b.title));
23
- }, [mangas, selectedMangaIds]);
24
-
25
- const filteredFolders = useMemo(() => {
26
- if (!searchTerm) return folders;
27
- return folders.filter(f => f.title.toLowerCase().includes(searchTerm.toLowerCase()));
28
- }, [folders, searchTerm]);
29
-
30
- const handleMove = async (folderId: string | null) => {
31
- try {
32
- setIsSaving(true);
33
- await moveToFolder(selectedMangaIds, folderId);
34
- if (folderId) {
35
- toast.success(`Movido exitosamente a la carpeta.`);
36
- } else {
37
- toast.success(`Removido de la carpeta exitosamente.`);
38
- }
39
- onSaveComplete();
40
- onClose();
41
- } catch (error) {
42
- console.error('Error moving to folder:', error);
43
- toast.error('Error al mover a la carpeta');
44
- } finally {
45
- setIsSaving(false);
46
- }
47
- };
48
-
49
- if (!isOpen) return null;
50
-
51
- return (
52
- <div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-4 animate-in fade-in duration-200">
53
- <div className="bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-md shadow-2xl overflow-hidden flex flex-col max-h-[80vh]">
54
- <div className="bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10 flex-shrink-0">
55
- <div className="flex items-center gap-3">
56
- <div className="p-2 bg-blue-500/10 rounded-lg text-blue-400">
57
- <FolderInput className="w-5 h-5" />
58
- </div>
59
- <div>
60
- <h2 className="text-xl font-bold text-white">Mover a Carpeta</h2>
61
- <p className="text-xs text-gray-400">Selecciona la carpeta de destino</p>
62
- </div>
63
- </div>
64
- <button onClick={onClose} className="text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg">
65
- <X className="w-5 h-5" />
66
- </button>
67
- </div>
68
-
69
- <div className="p-4 border-b border-gray-800 bg-[#121212] flex-shrink-0">
70
- <div className="relative">
71
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" />
72
- <input
73
- type="text"
74
- value={searchTerm}
75
- onChange={(e) => setSearchTerm(e.target.value)}
76
- placeholder="Buscar carpeta..."
77
- className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl pl-10 pr-4 py-3 text-sm text-white focus:outline-none focus:border-blue-500 transition-colors"
78
- />
79
- </div>
80
- </div>
81
-
82
- <div className="flex-1 overflow-y-auto p-4 space-y-2 custom-scrollbar">
83
- <button
84
- onClick={() => handleMove(null)}
85
- disabled={isSaving}
86
- className="w-full flex items-center gap-3 p-3 rounded-xl border border-dashed border-gray-700 hover:border-blue-500 hover:bg-blue-500/5 transition-all text-left group"
87
- >
88
- <div className="w-10 h-10 rounded-lg bg-gray-800 flex items-center justify-center group-hover:bg-blue-500/20 transition-colors">
89
- <span className="text-lg">🏠</span>
90
- </div>
91
- <div className="flex-1">
92
- <h3 className="text-sm font-semibold text-white">Raíz (Pantalla principal)</h3>
93
- <p className="text-xs text-gray-400 border-gray-700">Sacar de cualquier carpeta</p>
94
- </div>
95
- </button>
96
-
97
- <div className="h-px bg-gray-800 my-4" />
98
-
99
- {filteredFolders.map((folder) => (
100
- <button
101
- key={folder.id}
102
- onClick={() => handleMove(folder.id)}
103
- disabled={isSaving}
104
- className="w-full flex items-center gap-3 p-3 rounded-xl border border-gray-800 bg-[#1a1a1a] hover:border-blue-500 transition-all text-left group"
105
- >
106
- <div className="w-10 h-10 rounded-lg bg-gray-800 flex items-center justify-center overflow-hidden">
107
- <FolderInput className="w-5 h-5 text-gray-400 group-hover:text-blue-400 transition-colors" />
108
- </div>
109
- <div className="flex-1">
110
- <h3 className="text-sm font-semibold text-white group-hover:text-blue-400 transition-colors">{folder.title}</h3>
111
- <p className="text-xs text-gray-400">Carpeta</p>
112
- </div>
113
- </button>
114
- ))}
115
-
116
- {filteredFolders.length === 0 && (
117
- <div className="text-center py-8 text-gray-500">
118
- No hay carpetas disponibles
119
- </div>
120
- )}
121
- </div>
122
- </div>
123
- </div>
124
- );
125
- }
 
1
+ import { useState, useMemo } from 'react';
2
+ import { X, FolderInput, Search } from 'lucide-react';
3
+ import { toast } from 'sonner';
4
+ import { moveToFolder } from '../services/manga';
5
+ import { Manga } from '../types/manga';
6
+
7
+ interface MoveToFolderModalProps {
8
+ isOpen: boolean;
9
+ onClose: () => void;
10
+ selectedMangaIds: string[];
11
+ mangas: Manga[];
12
+ onSaveComplete: () => void;
13
+ }
14
+
15
+ export function MoveToFolderModal({ isOpen, onClose, selectedMangaIds, mangas, onSaveComplete }: MoveToFolderModalProps) {
16
+ const [searchTerm, setSearchTerm] = useState('');
17
+ const [isSaving, setIsSaving] = useState(false);
18
+
19
+ const folders = useMemo(() => {
20
+ return mangas
21
+ .filter(m => m.is_folder && !selectedMangaIds.includes(m.id))
22
+ .sort((a, b) => a.title.localeCompare(b.title));
23
+ }, [mangas, selectedMangaIds]);
24
+
25
+ const filteredFolders = useMemo(() => {
26
+ if (!searchTerm) return folders;
27
+ return folders.filter(f => f.title.toLowerCase().includes(searchTerm.toLowerCase()));
28
+ }, [folders, searchTerm]);
29
+
30
+ const handleMove = async (folderId: string | null) => {
31
+ try {
32
+ setIsSaving(true);
33
+ await moveToFolder(selectedMangaIds, folderId);
34
+ if (folderId) {
35
+ toast.success(`Movido exitosamente a la carpeta.`);
36
+ } else {
37
+ toast.success(`Removido de la carpeta exitosamente.`);
38
+ }
39
+ onSaveComplete();
40
+ onClose();
41
+ } catch (error) {
42
+ console.error('Error moving to folder:', error);
43
+ toast.error('Error al mover a la carpeta');
44
+ } finally {
45
+ setIsSaving(false);
46
+ }
47
+ };
48
+
49
+ if (!isOpen) return null;
50
+
51
+ return (
52
+ <div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[70] p-4 animate-in fade-in duration-200">
53
+ <div className="bg-[#121212] rounded-2xl border border-gray-800 w-full max-w-md shadow-2xl overflow-hidden flex flex-col max-h-[80vh]">
54
+ <div className="bg-[#1a1a1a] border-b border-gray-800 px-6 py-4 flex items-center justify-between sticky top-0 z-10 flex-shrink-0">
55
+ <div className="flex items-center gap-3">
56
+ <div className="p-2 bg-blue-500/10 rounded-lg text-blue-400">
57
+ <FolderInput className="w-5 h-5" />
58
+ </div>
59
+ <div>
60
+ <h2 className="text-xl font-bold text-white">Mover a Carpeta</h2>
61
+ <p className="text-xs text-gray-400">Selecciona la carpeta de destino</p>
62
+ </div>
63
+ </div>
64
+ <button onClick={onClose} className="text-gray-400 hover:text-white transition-colors p-2 hover:bg-white/5 rounded-lg">
65
+ <X className="w-5 h-5" />
66
+ </button>
67
+ </div>
68
+
69
+ <div className="p-4 border-b border-gray-800 bg-[#121212] flex-shrink-0">
70
+ <div className="relative">
71
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400" />
72
+ <input
73
+ type="text"
74
+ value={searchTerm}
75
+ onChange={(e) => setSearchTerm(e.target.value)}
76
+ placeholder="Buscar carpeta..."
77
+ className="w-full bg-[#1a1a1a] border border-gray-700 rounded-xl pl-10 pr-4 py-3 text-sm text-white focus:outline-none focus:border-blue-500 transition-colors"
78
+ />
79
+ </div>
80
+ </div>
81
+
82
+ <div className="flex-1 overflow-y-auto p-4 space-y-2 custom-scrollbar">
83
+ <button
84
+ onClick={() => handleMove(null)}
85
+ disabled={isSaving}
86
+ className="w-full flex items-center gap-3 p-3 rounded-xl border border-dashed border-gray-700 hover:border-blue-500 hover:bg-blue-500/5 transition-all text-left group"
87
+ >
88
+ <div className="w-10 h-10 rounded-lg bg-gray-800 flex items-center justify-center group-hover:bg-blue-500/20 transition-colors">
89
+ <span className="text-lg">🏠</span>
90
+ </div>
91
+ <div className="flex-1">
92
+ <h3 className="text-sm font-semibold text-white">Raíz (Pantalla principal)</h3>
93
+ <p className="text-xs text-gray-400 border-gray-700">Sacar de cualquier carpeta</p>
94
+ </div>
95
+ </button>
96
+
97
+ <div className="h-px bg-gray-800 my-4" />
98
+
99
+ {filteredFolders.map((folder) => (
100
+ <button
101
+ key={folder.id}
102
+ onClick={() => handleMove(folder.id)}
103
+ disabled={isSaving}
104
+ className="w-full flex items-center gap-3 p-3 rounded-xl border border-gray-800 bg-[#1a1a1a] hover:border-blue-500 transition-all text-left group"
105
+ >
106
+ <div className="w-10 h-10 rounded-lg bg-gray-800 flex items-center justify-center overflow-hidden">
107
+ <FolderInput className="w-5 h-5 text-gray-400 group-hover:text-blue-400 transition-colors" />
108
+ </div>
109
+ <div className="flex-1">
110
+ <h3 className="text-sm font-semibold text-white group-hover:text-blue-400 transition-colors">{folder.title}</h3>
111
+ <p className="text-xs text-gray-400">Carpeta</p>
112
+ </div>
113
+ </button>
114
+ ))}
115
+
116
+ {filteredFolders.length === 0 && (
117
+ <div className="text-center py-8 text-gray-500">
118
+ No hay carpetas disponibles
119
+ </div>
120
+ )}
121
+ </div>
122
+ </div>
123
+ </div>
124
+ );
125
+ }