fix: fall back to Bunny Storage for cover images
This commit is contained in:
@@ -38,6 +38,7 @@ import { Course, Comment, Attachment, Lesson, AttachmentType, LessonMedia } from
|
||||
import { useToast } from '../context/ToastContext';
|
||||
import { getManagedCourses, saveCourse, deleteCourse, duplicateCourse, getComments, replyToComment, moderateComment } from '../services/db';
|
||||
import { getAttachmentIcon, getAttachmentBadge } from '../components/MaterialCard';
|
||||
import { CourseCoverImage } from '../components/CourseCoverImage';
|
||||
import { BunnyVideo, courseApi, instructorApi, InstructorAnalytics } from '../services/api';
|
||||
|
||||
const formatVideoDuration = (seconds: number | null | undefined) => {
|
||||
@@ -514,10 +515,10 @@ const CourseModal: React.FC<{
|
||||
<p className="mt-1 text-xs text-gray-400">Tente enviá-la novamente. Se o problema continuar, verifique a configuração de entrega de imagens.</p>
|
||||
</div>
|
||||
) : (
|
||||
<img
|
||||
src={thumbnailPreview}
|
||||
<CourseCoverImage
|
||||
source={thumbnailPreview}
|
||||
alt="Prévia da imagem de capa"
|
||||
onError={() => setCoverPreviewError(true)}
|
||||
onFinalError={() => setCoverPreviewError(true)}
|
||||
className="h-full w-full object-cover opacity-80 transition-transform duration-200"
|
||||
style={{
|
||||
transform: `scale(${coverImageZoom})`,
|
||||
@@ -1078,8 +1079,8 @@ export const ManageCourses: React.FC = () => {
|
||||
<div>
|
||||
{/* Thumbnail */}
|
||||
<div className="aspect-video relative overflow-hidden bg-black rounded-t-[8px]">
|
||||
<img
|
||||
src={course.thumbnail}
|
||||
<CourseCoverImage
|
||||
source={course.thumbnail}
|
||||
alt={course.title}
|
||||
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user