@golstats/gsc-reports 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +2 -0
  2. package/dist/FilterConditions-55d68355-C5NIJbY6-xW04mYhu-DRN4eEO4.js +191 -0
  3. package/dist/FilterField-59a73e38-DO8nYLqs-Da7H_Fvj-ZuLwDGOM.js +21 -0
  4. package/dist/FilterSubcategories-a9b32cc9-DlkHni1L-BXid_sIn-BvoU3OqZ.js +42 -0
  5. package/dist/css/fonts.css +83 -0
  6. package/dist/fonts/BebasNeue-Bold.otf +0 -0
  7. package/dist/fonts/BebasNeue-Bold.ttf +0 -0
  8. package/dist/fonts/BebasNeue-Bold.woff2 +0 -0
  9. package/dist/fonts/BebasNeue-Book.otf +0 -0
  10. package/dist/fonts/BebasNeue-Book.ttf +0 -0
  11. package/dist/fonts/BebasNeue-Book.woff2 +0 -0
  12. package/dist/fonts/BebasNeue-Light.otf +0 -0
  13. package/dist/fonts/BebasNeue-Light.ttf +0 -0
  14. package/dist/fonts/BebasNeue-Light.woff2 +0 -0
  15. package/dist/fonts/BebasNeue-Regular.otf +0 -0
  16. package/dist/fonts/BebasNeue-Regular.ttf +0 -0
  17. package/dist/fonts/BebasNeue-Regular.woff2 +0 -0
  18. package/dist/fonts/BebasNeue-Thin.otf +0 -0
  19. package/dist/fonts/BebasNeue-Thin.ttf +0 -0
  20. package/dist/fonts/BebasNeue-Thin.woff2 +0 -0
  21. package/dist/fonts/Montserrat-Black.otf +0 -0
  22. package/dist/fonts/Montserrat-BlackItalic.otf +0 -0
  23. package/dist/fonts/Montserrat-Bold.otf +0 -0
  24. package/dist/fonts/Montserrat-BoldItalic.otf +0 -0
  25. package/dist/fonts/Montserrat-ExtraBold.otf +0 -0
  26. package/dist/fonts/Montserrat-ExtraBoldItalic.otf +0 -0
  27. package/dist/fonts/Montserrat-ExtraLight.otf +0 -0
  28. package/dist/fonts/Montserrat-ExtraLightItalic.otf +0 -0
  29. package/dist/fonts/Montserrat-Italic.otf +0 -0
  30. package/dist/fonts/Montserrat-Light.otf +0 -0
  31. package/dist/fonts/Montserrat-LightItalic.otf +0 -0
  32. package/dist/fonts/Montserrat-Medium.otf +0 -0
  33. package/dist/fonts/Montserrat-MediumItalic.otf +0 -0
  34. package/dist/fonts/Montserrat-Regular.otf +0 -0
  35. package/dist/fonts/Montserrat-SemiBold.otf +0 -0
  36. package/dist/fonts/Montserrat-SemiBoldItalic.otf +0 -0
  37. package/dist/fonts/Montserrat-Thin.otf +0 -0
  38. package/dist/fonts/Montserrat-ThinItalic.otf +0 -0
  39. package/dist/fonts/Oswald-Bold.ttf +0 -0
  40. package/dist/fonts/Oswald-ExtraLight.ttf +0 -0
  41. package/dist/fonts/Oswald-Light.ttf +0 -0
  42. package/dist/fonts/Oswald-Medium.ttf +0 -0
  43. package/dist/fonts/Oswald-Regular.ttf +0 -0
  44. package/dist/fonts/Oswald-SemiBold.ttf +0 -0
  45. package/dist/fonts/Poppins-Black.otf +0 -0
  46. package/dist/fonts/Poppins-BlackItalic.otf +0 -0
  47. package/dist/fonts/Poppins-Bold.otf +0 -0
  48. package/dist/fonts/Poppins-BoldItalic.otf +0 -0
  49. package/dist/fonts/Poppins-ExtraBold.otf +0 -0
  50. package/dist/fonts/Poppins-ExtraBoldItalic.otf +0 -0
  51. package/dist/fonts/Poppins-ExtraLight.otf +0 -0
  52. package/dist/fonts/Poppins-ExtraLightItalic.otf +0 -0
  53. package/dist/fonts/Poppins-Italic.otf +0 -0
  54. package/dist/fonts/Poppins-Light.otf +0 -0
  55. package/dist/fonts/Poppins-LightItalic.otf +0 -0
  56. package/dist/fonts/Poppins-Medium.otf +0 -0
  57. package/dist/fonts/Poppins-MediumItalic.otf +0 -0
  58. package/dist/fonts/Poppins-Regular.otf +0 -0
  59. package/dist/fonts/Poppins-SemiBold.otf +0 -0
  60. package/dist/fonts/Poppins-SemiBoldItalic.otf +0 -0
  61. package/dist/fonts/Poppins-Thin.otf +0 -0
  62. package/dist/fonts/Poppins-ThinItalic.otf +0 -0
  63. package/dist/gsc-reports.css +1 -0
  64. package/dist/gsc-reports.es.js +4 -0
  65. package/dist/gsc-reports.umd.js +4079 -0
  66. package/dist/icons/icn-close.svg +5 -0
  67. package/dist/icons/icn-delete-delete.svg +3 -0
  68. package/dist/icons/icn-delete.svg +3 -0
  69. package/dist/icons/icn-download.svg +4 -0
  70. package/dist/icons/icn-duplicate-white.svg +11 -0
  71. package/dist/icons/icn-duplicate.svg +11 -0
  72. package/dist/icons/icn-edit.svg +11 -0
  73. package/dist/icons/icn-editar-withe.svg +3 -0
  74. package/dist/icons/icn-rename-white.svg +3 -0
  75. package/dist/icons/icn-rename.svg +3 -0
  76. package/dist/icons/icn-report-white.svg +11 -0
  77. package/dist/icons/icn-report.svg +11 -0
  78. package/dist/images/background-postmatch-template-01.jpg +0 -0
  79. package/dist/images/background-postmatch-template-02.jpg +0 -0
  80. package/dist/images/canchaRPH.svg +30 -0
  81. package/dist/index-B1R4W2EC.js +128151 -0
  82. package/dist/reports/background-postmatch-template-01@2x.jpg +0 -0
  83. package/dist/reports/background-postmatch-template-02@2x.jpg +0 -0
  84. package/dist/reports/thumbnail-portada-01@2x.png +0 -0
  85. package/dist/reports/thumbnail-portada-02@2x.png +0 -0
  86. package/dist/reports/thumbnail-portada-03@2x.png +0 -0
  87. package/dist/reports/thumbnail-portada-04@2x.png +0 -0
  88. package/dist/reports/thumbnail-portada-prmatch-01@2x.png +0 -0
  89. package/dist/reports/thumbnail-portada-prmatch-02@2x.png +0 -0
  90. package/dist/reports/thumbnail-portada-prmatch-03@2x.png +0 -0
  91. package/dist/reports/thumbnail-portada-prmatch-04@2x.png +0 -0
  92. package/dist/thumb1.png +0 -0
  93. package/dist/thumbnail-portada-01.jpg +0 -0
  94. package/dist/thumbnail-portada-02.jpg +0 -0
  95. package/dist/thumbnail-portada-03.jpg +0 -0
  96. package/dist/thumbnail-portada-04.jpg +0 -0
  97. package/dist/thumbnail-portada-prmatch-01.jpg +0 -0
  98. package/dist/thumbnail-portada-prmatch-02.jpg +0 -0
  99. package/dist/thumbnail-portada-prmatch-03.jpg +0 -0
  100. package/dist/thumbnail-portada-prmatch-04.jpg +0 -0
  101. package/package.json +70 -0
  102. package/src/App.vue +28 -0
  103. package/src/components/ReportsSection.vue +764 -0
  104. package/src/components/TemplatesSection.vue +911 -0
  105. package/src/components/elementsTemplates/ModalCreateTemplate.vue +407 -0
  106. package/src/components/elementsTemplates/ModalDeleteReport.vue +231 -0
  107. package/src/components/elementsTemplates/ModalDeleteTemplate.vue +234 -0
  108. package/src/components/elementsTemplates/ModalGenerarReporte.vue +1151 -0
  109. package/src/components/elementsTemplates/ModalRenameReporte.vue +315 -0
  110. package/src/components/elementsTemplates/ModalRenameTemplate.vue +320 -0
  111. package/src/components/elementsTemplates/ModalSoloEscritorio.vue +83 -0
  112. package/src/components/elementsTemplates/ModalduplicateTemplate.vue +283 -0
  113. package/src/components/elementsTemplates/ReportItem.vue +458 -0
  114. package/src/components/elementsTemplates/TemplateItem.vue +360 -0
  115. package/src/components/elementsTemplates/TooltipReportOptions.vue +85 -0
  116. package/src/components/elementsTemplates/TooltipTemplateOptions.vue +141 -0
  117. package/src/components/filters.vue +935 -0
  118. package/src/components/gsc-reports.vue +452 -0
  119. package/src/components/template-report-maker/CoverPage.vue +636 -0
  120. package/src/components/template-report-maker/CoverSelector.vue +165 -0
  121. package/src/components/template-report-maker/ReportAndTemplateMaker.vue +675 -0
  122. package/src/components/template-report-maker/ReportView.vue +66 -0
  123. package/src/components/template-report-maker/TemplateReportPage.vue +398 -0
  124. package/src/components/thumbnails-reports/AnalisisPostMatchType1.vue +741 -0
  125. package/src/components/thumbnails-reports/AnalisisPostMatchType2.vue +743 -0
  126. package/src/components/thumbnails-reports/AnalisisPostMatchType3.vue +463 -0
  127. package/src/components/thumbnails-reports/AnalisisPostMatchType4.vue +462 -0
  128. package/src/components/thumbnails-reports/AnalisisPrematchType1.vue +164 -0
  129. package/src/components/thumbnails-reports/AnalisisPrematchType2.vue +163 -0
  130. package/src/components/thumbnails-reports/AnalisisPrematchType3.vue +173 -0
  131. package/src/components/thumbnails-reports/AnalisisPrematchType4.vue +173 -0
  132. package/src/index.js +4 -0
  133. package/src/main.js +4 -0
  134. package/src/types.d.ts +45 -0
  135. package/src/utils/dateUtils.js +52 -0
@@ -0,0 +1,407 @@
1
+ <template>
2
+ <div class="modal-overlay" @click.self="$emit('close')">
3
+ <div class="modal-content">
4
+ <button class="close-btn" @click="$emit('close')">
5
+ <img src="/icons/icn-close.svg" alt="Cerrar" />
6
+ </button>
7
+ <div class="modal-header">
8
+ <img src="/icons/icn-editar-withe.svg" class="icon-title" alt="icon" />
9
+ <span class="modal-title">Crear Template</span>
10
+ </div>
11
+ <div class="header-separator"></div>
12
+ <div class="modal-body">
13
+ <template v-if="step === 1">
14
+ <div class="modal-label">Define el tipo de análisis para tu template:</div>
15
+ <div class="radio-group">
16
+ <label :class="['radio-label', { selected: selectedType === 'pre' }]">
17
+ <input type="radio" value="pre" v-model="selectedType" />
18
+ Prepartido
19
+ </label>
20
+ <label :class="['radio-label', { selected: selectedType === 'post' }]">
21
+ <input type="radio" value="post" v-model="selectedType" />
22
+ Postpartido
23
+ </label>
24
+ </div>
25
+ </template>
26
+ <template v-else>
27
+ <div class="modal-label">Agrega un nombre a tu template:</div>
28
+ <input
29
+ class="template-name-input"
30
+ type="text"
31
+ v-model="templateName"
32
+ placeholder="Untitled"
33
+ maxlength="40"
34
+ autocomplete="off"
35
+ :disabled="isLoading"
36
+ />
37
+ <div v-if="error" class="error-message">{{ error }}</div>
38
+ </template>
39
+ </div>
40
+ <div class="header-separator"></div>
41
+ <div class="modal-footer">
42
+ <button class="cancel-btn" @click="$emit('close')" :disabled="isLoading">Cancelar</button>
43
+ <button v-if="step === 1" class="next-btn" :disabled="!selectedType" @click="step = 2">
44
+ Siguiente
45
+ </button>
46
+ <button
47
+ v-else
48
+ class="next-btn"
49
+ :disabled="templateName.trim().length < 3 || isLoading"
50
+ @click="saveTemplate"
51
+ >
52
+ <div v-if="isLoading" class="loading-spinner"></div>
53
+ <span v-else>Guardar</span>
54
+ </button>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </template>
59
+
60
+ <script setup>
61
+ import { ref } from 'vue'
62
+ import axios from 'axios'
63
+ // Definir props
64
+ const props = defineProps({
65
+ token: {
66
+ type: String,
67
+ required: true,
68
+ },
69
+ })
70
+
71
+ const emit = defineEmits(['close', 'template-created', 'open-modal-new-template'])
72
+
73
+ const step = ref(1)
74
+ const selectedType = ref('pre')
75
+ const templateName = ref('')
76
+ const isLoading = ref(false)
77
+ const error = ref('')
78
+
79
+ const saveTemplate = async () => {
80
+ if (templateName.value.trim().length < 3) return
81
+
82
+ isLoading.value = true
83
+ error.value = ''
84
+
85
+ try {
86
+ const payload = {
87
+ name: templateName.value.trim(),
88
+ team_id: 1, // Valor por defecto, podrías hacerlo configurable
89
+ template_type: selectedType.value === 'pre' ? 1 : 2, // 1=prematch, 2=postmatch
90
+ }
91
+
92
+ console.log('toke mostrado es: ', props.token)
93
+ const axiosInstance = axios.create({ headers: { Authorization: `${props.token}` } })
94
+ const response = await axiosInstance.post(
95
+ `https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/templates`,
96
+ payload,
97
+ )
98
+
99
+ console.log('response.data', response.data)
100
+ // Emitir evento con el template creado
101
+ emit('template-created', response.data)
102
+
103
+ // Emitir evento para abrir modal de nuevo template
104
+ emit('open-modal-new-template', response.data?.data)
105
+
106
+ // Cerrar modal
107
+ emit('close')
108
+ } catch (err) {
109
+ console.error('Error al guardar template:', err)
110
+
111
+ // Manejar diferentes tipos de errores
112
+ if (err.response) {
113
+ // El servidor respondió con un código de estado de error
114
+ const status = err.response.status
115
+
116
+ if (status === 409) {
117
+ error.value = 'Ya existe un template con el mismo nombre'
118
+ }
119
+ }
120
+ } finally {
121
+ isLoading.value = false
122
+ }
123
+ }
124
+ </script>
125
+
126
+ <style scoped>
127
+ .modal-overlay {
128
+ position: fixed;
129
+ top: 0;
130
+ left: 0;
131
+ width: 100vw;
132
+ height: 100vh;
133
+ background: rgba(0, 0, 0, 0.45);
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ z-index: 3200;
138
+ }
139
+ .modal-content {
140
+ width: 368px;
141
+ height: 254px;
142
+ background: #2e3b46;
143
+ border-radius: 10px;
144
+ box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.18);
145
+ padding: 0;
146
+ position: relative;
147
+ display: flex;
148
+ flex-direction: column;
149
+ font-family: 'Poppins-Regular', 'Montserrat', sans-serif;
150
+ }
151
+ .close-btn {
152
+ position: absolute;
153
+ top: 16px;
154
+ right: 16px;
155
+ background: none;
156
+ border: none;
157
+ cursor: pointer;
158
+ z-index: 2;
159
+ padding: 0;
160
+ display: flex;
161
+ align-items: center;
162
+ justify-content: center;
163
+ }
164
+ .close-btn:hover {
165
+ opacity: 0.7;
166
+ }
167
+
168
+ .close-btn img {
169
+ width: 20px;
170
+ height: 20px;
171
+ }
172
+
173
+ .header-separator {
174
+ width: 100%;
175
+ height: 1px;
176
+ border-bottom: dashed 1px #58626b;
177
+ margin: 12px 0 0 0;
178
+ }
179
+ .modal-header {
180
+ display: flex;
181
+ align-items: center;
182
+ gap: 8px;
183
+ padding: 20px 24px 0 24px;
184
+ }
185
+ .icon-title {
186
+ width: 20px;
187
+ height: 20px;
188
+ }
189
+ .modal-title {
190
+ font-family: Poppins-Medium;
191
+ font-size: 17px;
192
+ font-weight: 500;
193
+ font-stretch: normal;
194
+ font-style: normal;
195
+ line-height: 1.5;
196
+ letter-spacing: normal;
197
+ text-align: left;
198
+ color: #fff;
199
+ }
200
+ .modal-body {
201
+ flex: 1;
202
+ display: flex;
203
+ flex-direction: column;
204
+ justify-content: center;
205
+ padding: 12px 24px 0 24px;
206
+ }
207
+ .modal-label {
208
+ font-family: Poppins-Regular;
209
+ font-size: 14px;
210
+ font-stretch: normal;
211
+ font-style: normal;
212
+ line-height: normal;
213
+ letter-spacing: -0.3px;
214
+ margin-top: -10px;
215
+ text-align: center;
216
+ color: rgba(255, 255, 255, 0.6);
217
+ margin-bottom: 18px;
218
+ }
219
+ .radio-group {
220
+ display: flex;
221
+ gap: 32px;
222
+ justify-content: center;
223
+ }
224
+ .radio-label {
225
+ display: flex;
226
+ align-items: center;
227
+ gap: 8px;
228
+ font-family: Poppins-Regular;
229
+ font-size: 13px;
230
+ font-weight: 500;
231
+ font-stretch: normal;
232
+ font-style: normal;
233
+ line-height: 1.2;
234
+ opacity: 0.7;
235
+ letter-spacing: -0.39px;
236
+ text-align: left;
237
+ color: #fff;
238
+ cursor: pointer;
239
+ margin-top: 5px;
240
+ position: relative;
241
+ padding-left: 0;
242
+ }
243
+ .radio-label input[type='radio'] {
244
+ width: 18px;
245
+ height: 18px;
246
+ margin-right: 0;
247
+ position: relative;
248
+ appearance: none;
249
+ -webkit-appearance: none;
250
+ border: 1px solid #fff;
251
+ border-radius: 50%;
252
+ background: transparent;
253
+ cursor: pointer;
254
+ opacity: 0.6;
255
+ display: flex;
256
+ margin-top: -1px;
257
+ align-items: center;
258
+ justify-content: center;
259
+ }
260
+
261
+ .radio-label input[type='radio']::after {
262
+ content: '';
263
+ display: block;
264
+ position: absolute;
265
+ top: 50%;
266
+ left: 50%;
267
+ transform: translate(-50%, -50%);
268
+ width: 8px;
269
+ height: 8px;
270
+ border-radius: 50%;
271
+ background: transparent;
272
+ }
273
+
274
+ .radio-label input[type='radio']:checked {
275
+ opacity: 1;
276
+ }
277
+
278
+ .radio-label input[type='radio']:checked::after {
279
+ background: #cbee6b;
280
+ }
281
+
282
+ .radio-label.selected {
283
+ opacity: 1;
284
+ }
285
+ .template-name-input {
286
+ width: 304px;
287
+ height: 44.5px;
288
+ border-radius: 6px;
289
+ border: 1px solid #3d4a54;
290
+ background: #2e3b46;
291
+ color: #fff;
292
+ font-family: Poppins-Regular;
293
+ font-size: 14px;
294
+ font-weight: normal;
295
+ font-stretch: normal;
296
+ font-style: normal;
297
+ line-height: normal;
298
+ letter-spacing: 0.1px;
299
+ text-align: left;
300
+ padding: 0 16px;
301
+ margin-bottom: 8px;
302
+ outline: none;
303
+ box-sizing: border-box;
304
+ transition: border 0.2s;
305
+ margin-left: auto;
306
+ margin-right: auto;
307
+ }
308
+ .template-name-input::placeholder {
309
+ color: #b0bec5;
310
+ opacity: 0.5;
311
+ }
312
+ .template-name-input:focus {
313
+ border: 1.5px solid rgba(224, 231, 240, 0.3);
314
+ }
315
+ .modal-footer {
316
+ display: flex;
317
+ justify-content: center;
318
+ align-items: center;
319
+ gap: 18px;
320
+ margin-top: 13px;
321
+ padding: 0 24px 12px 24px;
322
+ }
323
+ .cancel-btn {
324
+ background: none;
325
+ border: none;
326
+ color: #b0bec5;
327
+ font-size: 14.9px;
328
+ font-family: Poppins-Medium;
329
+ height: 30px;
330
+ border-radius: 64px;
331
+ display: flex;
332
+ align-items: center;
333
+ justify-content: center;
334
+ cursor: pointer;
335
+ padding: 0 18px;
336
+ transition: color 0.2s;
337
+ text-decoration: underline;
338
+ }
339
+ .cancel-btn:hover {
340
+ color: #fff;
341
+ }
342
+ .next-btn {
343
+ width: 107px;
344
+ height: 30px;
345
+ border-radius: 64px;
346
+ -webkit-backdrop-filter: blur(16px);
347
+ backdrop-filter: blur(16px);
348
+ border: solid 0.8px #cbee6b;
349
+ background-color: rgba(255, 255, 255, 0.06);
350
+ font-family: Poppins-Medium;
351
+ font-size: 14.9px;
352
+ font-weight: 500;
353
+ font-stretch: normal;
354
+ font-style: normal;
355
+ line-height: 1.2;
356
+ letter-spacing: -0.45px;
357
+ text-align: center;
358
+ color: #fff;
359
+ cursor: pointer;
360
+ transition:
361
+ background 0.2s,
362
+ color 0.2s;
363
+ display: flex;
364
+ align-items: center;
365
+ justify-content: center;
366
+ }
367
+ .next-btn:disabled {
368
+ opacity: 0.5;
369
+ cursor: not-allowed;
370
+ }
371
+ .next-btn:not(:disabled):hover {
372
+ background: #cbee6b;
373
+ color: #232e39;
374
+ }
375
+
376
+ .error-message {
377
+ color: #fcfcfc;
378
+ font-size: 12px;
379
+ opacity: 0.6;
380
+ text-align: center;
381
+ margin-top: 0px;
382
+ font-family: Poppins-Regular;
383
+ }
384
+
385
+ .template-name-input:disabled {
386
+ opacity: 0.6;
387
+ cursor: not-allowed;
388
+ }
389
+
390
+ .loading-spinner {
391
+ width: 16px;
392
+ height: 16px;
393
+ border: 2px solid transparent;
394
+ border-top: 2px solid #fff;
395
+ border-radius: 50%;
396
+ animation: spin 1s linear infinite;
397
+ }
398
+
399
+ @keyframes spin {
400
+ 0% {
401
+ transform: rotate(0deg);
402
+ }
403
+ 100% {
404
+ transform: rotate(360deg);
405
+ }
406
+ }
407
+ </style>
@@ -0,0 +1,231 @@
1
+ <template>
2
+ <div class="modal-overlay" @click.self="$emit('close')">
3
+ <div class="modal-content">
4
+ <button class="close-btn" @click="$emit('close')">
5
+ <img src="/icons/icn-close.svg" alt="Cerrar" />
6
+ </button>
7
+ <div class="modal-header">
8
+ <img src="/icons/icn-delete-delete.svg" class="icon-title" alt="icon" />
9
+ <span class="modal-title">Eliminar reporte</span>
10
+ </div>
11
+ <div class="header-separator"></div>
12
+ <div class="modal-body confirm-text">
13
+ ¿Estás seguro que deseas eliminar<br />
14
+ este reporte? Si lo haces no habrá manera<br />
15
+ de recuperarlo.
16
+ </div>
17
+ <div class="header-separator"></div>
18
+ <div class="modal-footer">
19
+ <button class="cancel-btn" @click="$emit('close')" :disabled="isDeleting">Cancelar</button>
20
+ <button class="delete-btn" @click="handleDelete" :disabled="isDeleting">
21
+ {{ isDeleting ? 'Eliminando...' : 'Eliminar' }}
22
+ </button>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup>
29
+ import { ref } from 'vue'
30
+ import axios from 'axios'
31
+
32
+ // Props para recibir el ID del reporte, user_id y token
33
+ const props = defineProps({
34
+ reportId: {
35
+ type: String,
36
+ required: true,
37
+ },
38
+ userId: {
39
+ type: String,
40
+ required: true,
41
+ },
42
+ token: {
43
+ type: String,
44
+ required: true,
45
+ },
46
+ })
47
+
48
+ // Emits para comunicar con el componente padre
49
+ const emit = defineEmits(['close', 'delete', 'reportDeleted'])
50
+
51
+ // Estado para controlar el loading
52
+ const isDeleting = ref(false)
53
+
54
+ // Función para eliminar el reporte
55
+ const handleDelete = async () => {
56
+ try {
57
+ isDeleting.value = true
58
+
59
+ const axiosInstance = axios.create({
60
+ headers: { Authorization: `${props.token}` },
61
+ })
62
+
63
+ const response = await axiosInstance.delete(
64
+ `https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${props.userId}/reports/${props.reportId}`,
65
+ )
66
+
67
+ console.log('Reporte eliminado exitosamente:', response.data)
68
+
69
+ // Emitir evento de eliminación exitosa
70
+ emit('reportDeleted', props.reportId)
71
+
72
+ // Cerrar el modal
73
+ emit('close')
74
+ } catch (error) {
75
+ console.error('Error al eliminar el reporte:', error)
76
+
77
+ // Aquí podrías mostrar un mensaje de error al usuario
78
+ alert('Error al eliminar el reporte. Por favor, intenta de nuevo.')
79
+ } finally {
80
+ isDeleting.value = false
81
+ }
82
+ }
83
+ </script>
84
+
85
+ <style scoped>
86
+ .modal-overlay {
87
+ position: fixed;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100vw;
91
+ height: 100vh;
92
+ background: rgba(0, 0, 0, 0.45);
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ z-index: 3200;
97
+ }
98
+ .modal-content {
99
+ width: 375px;
100
+ height: 218px;
101
+ background: #2e3b46;
102
+ border-radius: 10px;
103
+ box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.18);
104
+ padding: 0;
105
+ position: relative;
106
+ display: flex;
107
+ flex-direction: column;
108
+ font-family: 'Poppins-Regular', 'Montserrat', sans-serif;
109
+ }
110
+ .close-btn {
111
+ position: absolute;
112
+ top: 16px;
113
+ right: 16px;
114
+ background: none;
115
+ border: none;
116
+ cursor: pointer;
117
+ z-index: 2;
118
+ padding: 0;
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ }
123
+ .close-btn:hover {
124
+ opacity: 0.7;
125
+ }
126
+ .close-btn img {
127
+ width: 20px;
128
+ height: 20px;
129
+ }
130
+ .header-separator {
131
+ width: 100%;
132
+ height: 1px;
133
+ border-bottom: dashed 1px #58626b;
134
+ margin: 12px 0 0 0;
135
+ }
136
+ .modal-header {
137
+ display: flex;
138
+ align-items: center;
139
+ gap: 8px;
140
+ padding: 20px 24px 0 24px;
141
+ }
142
+ .icon-title {
143
+ width: 15px;
144
+ height: 15px;
145
+ }
146
+ .modal-title {
147
+ font-family: Poppins-Medium;
148
+ font-size: 14px;
149
+ font-weight: 500;
150
+ font-stretch: normal;
151
+ font-style: normal;
152
+ line-height: 1.5;
153
+ letter-spacing: normal;
154
+ text-align: left;
155
+ color: #fff;
156
+ }
157
+ .modal-body.confirm-text {
158
+ flex: 1;
159
+ display: flex;
160
+ flex-direction: column;
161
+ justify-content: center;
162
+ align-items: center;
163
+ padding: 4px 24px 0 24px;
164
+ opacity: 0.5;
165
+ font-family: Poppins-Regular;
166
+ font-size: 13px;
167
+ font-weight: normal;
168
+ font-stretch: normal;
169
+ font-style: normal;
170
+ line-height: 1.38;
171
+ letter-spacing: normal;
172
+ text-align: center;
173
+ color: #fff;
174
+ }
175
+ .modal-footer {
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ gap: 18px;
180
+ margin-top: 13px;
181
+ padding: 0 24px 12px 24px;
182
+ }
183
+ .cancel-btn {
184
+ background: none;
185
+ border: none;
186
+ color: #b0bec5;
187
+ font-size: 14.9px;
188
+ font-family: Poppins-Medium;
189
+ height: 30px;
190
+ border-radius: 64px;
191
+ display: flex;
192
+ align-items: center;
193
+ justify-content: center;
194
+ cursor: pointer;
195
+ padding: 0 18px;
196
+ transition: color 0.2s;
197
+ text-decoration: underline;
198
+ }
199
+ .cancel-btn:hover {
200
+ color: #fff;
201
+ }
202
+ .delete-btn {
203
+ width: 107px;
204
+ height: 30px;
205
+ border-radius: 64px;
206
+ -webkit-backdrop-filter: blur(16px);
207
+ backdrop-filter: blur(16px);
208
+ border: solid 0.8px #ff6b6b;
209
+ background-color: rgba(255, 255, 255, 0.06);
210
+ font-family: Poppins-Medium;
211
+ font-size: 14.9px;
212
+ font-weight: 500;
213
+ font-stretch: normal;
214
+ font-style: normal;
215
+ line-height: 1.2;
216
+ letter-spacing: -0.45px;
217
+ text-align: center;
218
+ color: #ff6b6b;
219
+ cursor: pointer;
220
+ transition:
221
+ background 0.2s,
222
+ color 0.2s;
223
+ display: flex;
224
+ align-items: center;
225
+ justify-content: center;
226
+ }
227
+ .delete-btn:hover {
228
+ background: #ff6b6b;
229
+ color: #fff;
230
+ }
231
+ </style>