diff --git a/src/components/TimelineChapters.tsx b/src/components/TimelineChapters.tsx index 66b5cec..694ff3f 100644 --- a/src/components/TimelineChapters.tsx +++ b/src/components/TimelineChapters.tsx @@ -13,6 +13,7 @@ interface TimelineChaptersProps { onChapterClick?: (time: number) => void; currentTime?: number; // Current video playback time in seconds accentColor?: string; + clickable?: boolean; // Control whether chapters are clickable } export function TimelineChapters({ @@ -20,6 +21,7 @@ export function TimelineChapters({ onChapterClick, currentTime = 0, accentColor = '#f97316', + clickable = true, }: TimelineChaptersProps) { // Format time in seconds to MM:SS or HH:MM:SS const formatTime = (seconds: number): string => { @@ -63,10 +65,11 @@ export function TimelineChapters({ return ( + {user ? ( + + ) : ( + + + + + + + Login atau Daftar + + + + Login + Daftar + + +
+
+ + setAuthEmail(e.target.value)} + required + /> +
+
+ + setAuthPassword(e.target.value)} + required + /> +
+ +
+
+ +
+
+ + setAuthName(e.target.value)} + required + /> +
+
+ + setAuthEmail(e.target.value)} + required + /> +
+
+ + setAuthPassword(e.target.value)} + required + minLength={6} + /> +
+ +
+
+
+
+
+ )}

Pembayaran aman dengan standar QRIS dari Bank Indonesia

Diproses oleh mitra pembayaran terpercaya

diff --git a/src/pages/ProductDetail.tsx b/src/pages/ProductDetail.tsx index 2794311..1d3d7ae 100644 --- a/src/pages/ProductDetail.tsx +++ b/src/pages/ProductDetail.tsx @@ -10,7 +10,7 @@ import { useAuth } from '@/hooks/useAuth'; import { toast } from '@/hooks/use-toast'; import { Skeleton } from '@/components/ui/skeleton'; import { formatIDR, formatDuration } from '@/lib/format'; -import { Video, Calendar, BookOpen, Play, Clock, ChevronDown, ChevronRight, Star, CheckCircle } from 'lucide-react'; +import { Video, Calendar, BookOpen, Play, Clock, ChevronDown, ChevronRight, Star, CheckCircle, Lock } from 'lucide-react'; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'; import { ReviewModal } from '@/components/reviews/ReviewModal'; import { ProductReviews } from '@/components/reviews/ProductReviews'; @@ -238,18 +238,18 @@ export default function ProductDetail() { {product.chapters.map((chapter, index) => (
product && navigate(`/webinar/${product.slug}`)} + className="flex items-center gap-3 p-3 rounded-lg transition-colors cursor-not-allowed opacity-75" + title="Beli webinar untuk mengakses konten ini" >
- + {formatChapterTime(chapter.time)}

{chapter.title}

- +
))}
@@ -420,13 +420,14 @@ export default function ProductDetail() { {lesson.chapters.map((chapter, chapterIndex) => (
product && navigate(`/bootcamp/${product.slug}`)} + className="flex items-center gap-2 py-1 px-2 text-xs text-muted-foreground rounded transition-colors cursor-not-allowed opacity-60" + title="Beli bootcamp untuk mengakses materi ini" > - + {formatChapterTime(chapter.time)} - {chapter.title} + {chapter.title} +
))} diff --git a/src/pages/WebinarRecording.tsx b/src/pages/WebinarRecording.tsx index 1b1c8eb..caf62d2 100644 --- a/src/pages/WebinarRecording.tsx +++ b/src/pages/WebinarRecording.tsx @@ -49,6 +49,7 @@ export default function WebinarRecording() { const [loading, setLoading] = useState(true); const [currentTime, setCurrentTime] = useState(0); const [accentColor, setAccentColor] = useState(''); + const [hasPurchased, setHasPurchased] = useState(false); const [userReview, setUserReview] = useState(null); const [reviewModalOpen, setReviewModalOpen] = useState(false); const playerRef = useRef(null); @@ -113,7 +114,10 @@ export default function WebinarRecording() { order.order_items?.some((item: any) => item.product_id === productData.id) ); - if (!hasDirectAccess && !hasPaidOrderAccess) { + const hasAccess = hasDirectAccess || hasPaidOrderAccess; + setHasPurchased(hasAccess); + + if (!hasAccess) { toast({ title: 'Akses ditolak', description: 'Anda tidak memiliki akses ke webinar ini', variant: 'destructive' }); navigate('/dashboard'); return;